From e6323f71424e4730372914a47d9b7b5f4bb410b4 Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 6 May 2010 16:37:50 +0000 Subject: [PATCH] Fix recent space skipping: 1) add missing (unsigned char) cast to ctype() macro 2) fix off-by-one error causing last letter always doubled --- usr.bin/calendar/io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 42abca62b9b9..d12783f474c6 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)