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:
Andrey A. Chernov 2010-05-06 16:37:50 +00:00
parent 52683078a2
commit b277fb56f9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207701

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)