Esin Andrey <[EMAIL PROTECTED]> writes:

>Hi!
>I try to compile tar-1.18 and have one warning:
>
>utf8.c: In function ‘string_ascii_p’
>utf8.c:94: warning: comparison is always true due to limited range of
>data type
>
>I try to write patch to correct this warning (it is in attach)
>
>GCC version:
>gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
>
>diff -urN tar-1.18.orig/src/utf8.c tar-1.18/src/utf8.c
>--- tar-1.18.orig/src/utf8.c   2007-06-27 17:30:32.000000000 +0400
>+++ tar-1.18/src/utf8.c        2007-08-25 13:41:16.000000000 +0400
>@@ -91,7 +91,7 @@
> string_ascii_p (char const *p)
> {
>   for (; *p; p++)
>-    if (! (0 <= *p && *p <= 127))
>+    if ( 127 <= *p && *p <= 0)
>       return false;
>   return true;
> }

Now the function will always return true, because no value ever can be <=
0 and >= 127 at the same time, right?  Oder do I miss something?
-- 
Wer mir E-Mail schreiben will, stelle   | When writing me e-mail, please
bitte vor meine E-Mail-Adresse meinen   | precede my e-mail address with
Vor- und Nachnamen, etwa so:            | my full name, like
Helmut Waitzmann <[EMAIL PROTECTED]>, (Helmut Waitzmann) [EMAIL PROTECTED]


Reply via email to