There is a bug in the program "x10.c", routine day2bits(): day2bits(p) char *p; { char c, buf[4]; ... } The dimension on buf[] should be 6, not 4.