svn commit: r207701 - head/usr.bin/calendar
Andrey A. Chernov
ache at FreeBSD.org
Thu May 6 16:37:51 UTC 2010
Author: ache
Date: Thu May 6 16:37:50 2010
New Revision: 207701
URL: http://svn.freebsd.org/changeset/base/207701
Log:
Fix recent space skipping:
1) add missing (unsigned char) cast to ctype() macro
2) fix off-by-one error causing last letter always doubled
Modified:
head/usr.bin/calendar/io.c
Modified: head/usr.bin/calendar/io.c
==============================================================================
--- head/usr.bin/calendar/io.c Thu May 6 15:52:08 2010 (r207700)
+++ head/usr.bin/calendar/io.c Thu May 6 16:37:50 2010 (r207701)
@@ -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)
More information about the svn-src-head
mailing list