Fixed the source code.
Wrote all. I think it won't work properly.

Note that the type of dned was changed to unsigned char from _Bool.