changeset 14842:e7fdc5219b0d

trim: avoid a warning from -O2 -Wstrict-overflow * lib/trim.c (trim2): Declare local to be "unsigned int", not "int".
author Jim Meyering <meyering@redhat.com>
date Sat, 28 May 2011 16:00:20 +0200
parents 9341bfde6165
children c2b5c400a991
files ChangeLog lib/trim.c
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-28  Jim Meyering  <meyering@redhat.com>
+
+	trim: avoid a warning from -O2 -Wstrict-overflow
+	* lib/trim.c (trim2): Declare local to be "unsigned int", not "int".
+
 2011-05-29  Bruno Haible  <bruno@clisp.org>
 
 	gnulib-tool: Fix bug in yesterday's commit.
--- a/lib/trim.c
+++ b/lib/trim.c
@@ -65,7 +65,7 @@
       /* Trim trailing whitespaces. */
       if (how != TRIM_LEADING)
         {
-          int state = 0;
+          unsigned int state = 0;
           char *r IF_LINT (= NULL); /* used only while state = 2 */
 
           mbi_init (i, d, strlen (d));
@@ -130,4 +130,3 @@
 
   return d;
 }
-