[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] tar-1.18
From: |
Eric Blake |
Subject: |
Re: [Bug-tar] tar-1.18 |
Date: |
Sat, 25 Aug 2007 08:47:01 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666 |
According to Esin Andrey on 8/25/2007 4:05 AM:
> utf8.c: In function ‘string_ascii_p’
> utf8.c:94: warning: comparison is always true due to limited range of
> data type
>
Why not this simpler patch, which avoids a branch?
2007-08-25 Eric Blake <address@hidden>
* src/utf8.c (string_ascii_p): Avoid compiler warning.
Index: src/utf8.c
===================================================================
RCS file: /sources/tar/tar/src/utf8.c,v
retrieving revision 1.10
diff -u -p -r1.10 utf8.c
--- src/utf8.c 27 Jun 2007 13:30:15 -0000 1.10
+++ src/utf8.c 25 Aug 2007 14:44:31 -0000
@@ -91,7 +91,7 @@ bool
string_ascii_p (char const *p)
{
for (; *p; p++)
- if (! (0 <= *p && *p <= 127))
+ if ((*p & ~0x7f))
return false;
return true;
}
--
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden