projects
/
gnulib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
586b707
)
trim: avoid a warning from -O2 -Wstrict-overflow
author
Jim Meyering
<meyering@redhat.com>
Sat, 28 May 2011 14:00:20 +0000
(16:00 +0200)
committer
Ian Beckwith
<ianb@erislabs.net>
Thu, 9 Jun 2011 19:48:15 +0000
(20:48 +0100)
* lib/trim.c (trim2): Declare local to be "unsigned int", not "int".
(cherry picked from commit
244906802a300a1744de8881857a3a2897b3db8b
)
ChangeLog
patch
|
blob
|
history
lib/trim.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index
8d20573
..
3f5235a
100644
(file)
--- 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-28 Bruno Haible <bruno@clisp.org>
getloadavg: Remove an unreliable safety check.
diff --git
a/lib/trim.c
b/lib/trim.c
index
1f4d0c1
..
6515cfa
100644
(file)
--- a/
lib/trim.c
+++ b/
lib/trim.c
@@
-65,7
+65,7
@@
trim2 (const char *s, int how)
/* 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
@@
trim2 (const char *s, int how)
return d;
}
-