Date: Thu, 6 May 2010 16:37:51 +0000 (UTC) From: "Andrey A. Chernov" <ache@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r207701 - head/usr.bin/calendar Message-ID: <201005061637.o46GbpIU029341@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005061637.o46GbpIU029341>