summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 26a6b8e)
raw | patch | inline | side by side (parent: 26a6b8e)
author | Aurelien Reynaud <collectd@wattapower.net> | |
Wed, 12 May 2010 09:55:05 +0000 (11:55 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 19 May 2010 10:29:40 +0000 (12:29 +0200) |
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 <collectd@wattapower.net>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
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 <collectd@wattapower.net>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/snmp.c | patch | blob | history |
diff --git a/src/snmp.c b/src/snmp.c
index 693cd8942ffc10919e6e7d9d9b1084096818a3e7..8e72ce60d99a8349e7b33f8809ced26bf0a3a37f 100644 (file)
--- a/src/snmp.c
+++ b/src/snmp.c
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];
}