From df69fe8118215a80bb1f2e4b1a68c508abffb054 Mon Sep 17 00:00:00 2001 From: Aurelien Reynaud Date: Wed, 12 May 2010 11:55:05 +0200 Subject: [PATCH] snmp.c: compilation fixes for AIX The C and C++ standards allows the character type char to be signed or unsigned, depending on the platform and compiler. Most systems, including x86 GNU/Linux and Microsoft Windows, use signed char, but those based on PowerPC and ARM processors typically use unsigned char. This patch fixes a "comparison is always true" warning on AIX (powerpc) which leads the compilation to abort because of the -Werror flag. Being unsigned by default, a char is always >0. Signed-off-by: Aurelien Reynaud Signed-off-by: Florian Forster --- src/snmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snmp.c b/src/snmp.c index 693cd894..8e72ce60 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -965,7 +965,7 @@ static int csnmp_strvbcopy (char *dst, /* {{{ */ for (i = 0; i < num_chars; i++) { /* Check for control characters. */ - if ((src[i] >= 0) && (src[i] < 32)) + if ((unsigned char)src[i] < 32) return (csnmp_strvbcopy_hexstring (dst, vb, dst_size)); dst[i] = src[i]; } -- 2.11.0