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)
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to