Standardization.

This now compiles with "gcc -std=c89 -D_XOPEN_SOURCE=500 -pedantic" without warnings.

clang with exactly the same options as above will issue just one warning which suggests that a code fragment it refers to does something else than its author intended, but I was unable to understand what the intent was.

With additional flags -Wall -Wno-comment, you'll get warnings (not too many), that require further investigation and making design decisions. Apart from that, the code could use some re-factoring and debugging, but that kind of task requires a maintainer, which I'm not willing to be.