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:
parent
a4eb017f2a
commit
e6323f7142
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user