Fix use of isspace() function.
authorBruno Haible <bruno@clisp.org>
Wed, 16 Apr 2008 01:26:46 +0000 (03:26 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 16 Apr 2008 01:26:46 +0000 (03:26 +0200)
ChangeLog
lib/trim.c

index 2ceaa9c..c859ea6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-04-15  Bruno Haible  <bruno@clisp.org>
+
+       * lib/trim.c (trim2): Fix argument of isspace() macro.
+
 2008-04-15  Paolo Bonzini  <bonzini@gnu.org>
 
        * lib/tanl.c (kernel_tanl): Rename flag to invert, initialize it
index 6a71578..3813ca8 100644 (file)
@@ -113,7 +113,7 @@ trim2(const char *s, int how)
       
       /* Trim leading whitespaces. */
       if (how != TRIM_TRAILING) {
-       for (p = d; *p && isspace (*p); p++)
+       for (p = d; *p && isspace ((unsigned char) *p); p++)
          ;                     
 
        memmove (d, p, strlen (p) + 1);
@@ -121,7 +121,7 @@ trim2(const char *s, int how)
 
       /* Trim trailing whitespaces. */
       if (how != TRIM_LEADING) {
-       for (p = d + strlen (d) - 1; p >= d && isspace (*p); p--)
+       for (p = d + strlen (d) - 1; p >= d && isspace ((unsigned char) *p); p--)
          *p = '\0';
       }
     }