]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: fix a warning emitted by isblank() on non-c99 compilers
authorWilly Tarreau <w@1wt.eu>
Wed, 13 Feb 2013 11:47:12 +0000 (12:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 Feb 2013 11:49:46 +0000 (12:49 +0100)
Commit a2b9dad introduced use of isblank() which is not present everywhere
and requires -std=c99 or various other defines. Here on gcc-3.4 with glibc
2.3 it emits a warning though it works :

  src/checks.c: In function 'event_srv_chk_r':
  src/checks.c:1007: warning: implicit declaration of function 'isblank'

This macro matches only 2 values, better replace it with the explicit match.

src/checks.c

index 1a53669170b3d91998ceca726151b703327946e3..2ab509d6b0557bba27c6921316e1afd0f25ef0de 100644 (file)
@@ -1004,10 +1004,10 @@ static void event_srv_chk_r(struct connection *conn)
                         * The command keyword must terminated the string or
                         * be followed by a blank.
                         */
-                       if (end[0] == '\0' || isblank(end[0])) {
+                       if (end[0] == '\0' || end[0] == ' ' || end[0] == '\t') {
                                status = HCHK_STATUS_L7STS;
                                /* Skip over leading blanks */
-                               while (end[0] != '\0' && isblank(end[0]))
+                               while (end[0] != '\0' && (end[0] == ' ' || end[0] == '\t'))
                                        end++;
                                desc = end;
                        }