findutils-patches
[Top][All Lists]
Advanced

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

[Findutils-patches] Avoid ctype abuse


From: Eric Blake
Subject: [Findutils-patches] Avoid ctype abuse
Date: Mon, 11 May 2009 17:12:19 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Not all platform/locale combinations gracefully handle calling the ctype macros 
with plain char; at any rate, it is undefined per POSIX.  OK to apply?


From: Eric Blake <address@hidden>
Date: Mon, 11 May 2009 11:08:39 -0600
Subject: [PATCH] xargs: avoid compiler warning

* xargs/xargs.c (get_char_oct_or_hex_escape): Pass correct type to
ctype macro.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog     |    6 ++++++
 xargs/xargs.c |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3b3f5f5..76063d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-11  Eric Blake  <address@hidden>
+
+       xargs: avoid compiler warning
+       * xargs/xargs.c (get_char_oct_or_hex_escape): Pass correct type to
+       ctype macro.
+
 2009-05-04  James Youngman  <address@hidden>

        * find/util.c (get_info): Don't fall off the end of the function
diff --git a/xargs/xargs.c b/xargs/xargs.c
index 89d18c4..48b1cc0 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -1,6 +1,6 @@
 /* xargs -- build and execute command lines from standard input
    Copyright (C) 1990, 91, 92, 93, 94, 2000, 2003, 2004, 2005, 2006,
-   2007, 2008 Free Software Foundation, Inc.
+   2007, 2008, 2009 Free Software Foundation, Inc.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -262,7 +262,7 @@ get_char_oct_or_hex_escape(const char *s)
       p = s+2;
       base = 16;
     }
-  else if (isdigit(s[1]))
+  else if (isdigit ((unsigned char) s[1]))
     {
       /* octal */
       p = s+1;
-- 
1.6.2.4







reply via email to

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