Uses of ctype.h functions must pass the values 0 through 255 (or EOF) and not sign-extended negative values from signed char. Per standard practice, cast to unsigned char when calling.--
Also, fix an assertion about the return value of puts() - it returns EOF on error, not zero.