bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] tar-1.18


From: Helmut Waitzmann
Subject: Re: [Bug-tar] tar-1.18
Date: Sat, 25 Aug 2007 17:04:26 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Esin Andrey <address@hidden> 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 <address@hidden>, (Helmut Waitzmann) address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]