summaryrefslogtreecommitdiffstats
path: root/usr.bin/calendar
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2010-05-06 16:37:50 +0000
committerache <ache@FreeBSD.org>2010-05-06 16:37:50 +0000
commite6323f71424e4730372914a47d9b7b5f4bb410b4 (patch)
treedab116003c71802a5ce0283027b5bc0add982173 /usr.bin/calendar
parenta4eb017f2a2b295af55831f9ab117c78198cdef2 (diff)
downloadFreeBSD-src-e6323f71424e4730372914a47d9b7b5f4bb410b4.zip
FreeBSD-src-e6323f71424e4730372914a47d9b7b5f4bb410b4.tar.gz
Fix recent space skipping:
1) add missing (unsigned char) cast to ctype() macro 2) fix off-by-one error causing last letter always doubled
Diffstat (limited to 'usr.bin/calendar')
-rw-r--r--usr.bin/calendar/io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c
index 42abca6..d12783f 100644
--- a/usr.bin/calendar/io.c
+++ b/usr.bin/calendar/io.c
@@ -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)
OpenPOWER on IntegriCloud