argp: avoid undefined behavior
authorEric Blake <ebb9@byu.net>
Mon, 11 May 2009 11:54:20 +0000 (05:54 -0600)
committerEric Blake <ebb9@byu.net>
Mon, 11 May 2009 11:55:18 +0000 (05:55 -0600)
* lib/argp-fmtstream.c (weak_alias): Pass correct types to ctype
macros.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/argp-fmtstream.c

index 0dfb024..acf2934 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-11  Eric Blake  <ebb9@byu.net>
+
+       argp: avoid undefined behavior
+       * lib/argp-fmtstream.c (weak_alias): Pass correct types to ctype
+       macros.
+
 2009-05-08  Simon Josefsson  <simon@josefsson.org>
 
        * tests/test-vc-list-files-git.sh: Do git config of user.email and
@@ -41,7 +47,7 @@
        * modules/alignof: New file.
 
 2009-05-04  David Bartley  <dtbartle@csclub.uwaterloo.ca>
-            Bruno Haible  <bruno@clisp.org>
+           Bruno Haible  <bruno@clisp.org>
 
        Fix test-file-has-acl on FreeBSD.
        * tests/test-file-has-acl.sh: Also test a directory. On FreeBSD, the
@@ -74,7 +80,7 @@
        * top/maint.mk (no-submodule-changes): Don't assume a srcdir build.
 
 2009-05-04  David Bartley  <dtbartle@csclub.uwaterloo.ca>
-            Bruno Haible  <bruno@clisp.org>
+           Bruno Haible  <bruno@clisp.org>
 
        acl: Fix infinite loop on FreeBSD.
        * lib/acl_entries.c (acl_entries) [Linux, FreeBSD]: Fix interpretation
        * tests/test-priv-set.c: New file.
 
 2009-05-03  Jim Meyering  <meyering@redhat.com>
-            Bruno Haible  <bruno@clisp.org>
+           Bruno Haible  <bruno@clisp.org>
 
        * lib/propername.c (proper_name_utf8): Ignore no-op translations;
        use the converted UTF-8 variant of the name instead.
index c89a99c..7e6d9c6 100644 (file)
@@ -226,7 +226,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
          int i;
 
          p = buf + (r + 1 - fs->point_col);
-         while (p >= buf && !isblank (*p))
+         while (p >= buf && !isblank ((unsigned char) *p))
            --p;
          nextline = p + 1;     /* This will begin the next line.  */
 
@@ -236,7 +236,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
              if (p >= buf)
                do
                  --p;
-               while (p >= buf && isblank (*p));
+               while (p >= buf && isblank ((unsigned char) *p));
              nl = p + 1;       /* The newline will replace the first blank. */
            }
          else
@@ -248,7 +248,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
              if (p < nl)
                do
                  ++p;
-               while (p < nl && !isblank (*p));
+               while (p < nl && !isblank ((unsigned char) *p));
              if (p == nl)
                {
                  /* It already ends a line.  No fussing required.  */
@@ -261,7 +261,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
              /* Swallow separating blanks.  */
              do
                ++p;
-             while (isblank (*p));
+             while (isblank ((unsigned char) *p));
              /* The next line will start here.  */
              nextline = p;
            }