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
52683078a2
commit
b277fb56f9
@ -155,8 +155,8 @@ cal(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get rid of leading spaces (non-standard) */
|
/* Get rid of leading spaces (non-standard) */
|
||||||
while (isspace(buf[0]))
|
while (isspace((unsigned char)buf[0]))
|
||||||
memcpy(buf, buf + 1, strlen(buf) - 1);
|
memcpy(buf, buf + 1, strlen(buf));
|
||||||
|
|
||||||
/* No tab in the line, then not a valid line */
|
/* No tab in the line, then not a valid line */
|
||||||
if ((pp = strchr(buf, '\t')) == NULL)
|
if ((pp = strchr(buf, '\t')) == NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user