Fix recent space skipping:

1) add missing (unsigned char) cast to ctype() macro
2) fix off-by-one error causing last letter always doubled
This commit is contained in:
ache 2010-05-06 16:37:50 +00:00
parent a4eb017f2a
commit e6323f7142

View File

@ -155,8 +155,8 @@ cal(void)
}
/* Get rid of leading spaces (non-standard) */
while (isspace(buf[0]))
memcpy(buf, buf + 1, strlen(buf) - 1);
while (isspace((unsigned char)buf[0]))
memcpy(buf, buf + 1, strlen(buf));
/* No tab in the line, then not a valid line */
if ((pp = strchr(buf, '\t')) == NULL)