From: Florian Forster Date: Sun, 11 Mar 2012 11:57:10 +0000 (+0100) Subject: network plugin: Fix compiler warnings. X-Git-Tag: collectd-4.10.7~12 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b21e598ce9b4dc65261119fa1c8551ebc98fda78;p=collectd.git network plugin: Fix compiler warnings. Resolves GitHub issue #49. --- diff --git a/src/network.c b/src/network.c index 700b27f0..06cc2c50 100644 --- a/src/network.c +++ b/src/network.c @@ -704,7 +704,7 @@ static int parse_part_values (void **ret_buffer, size_t *ret_buffer_len, exp_size = 3 * sizeof (uint16_t) + pkg_numval * (sizeof (uint8_t) + sizeof (value_t)); - if ((buffer_len < 0) || (buffer_len < exp_size)) + if (buffer_len < exp_size) { WARNING ("network plugin: parse_part_values: " "Packet too short: " @@ -789,7 +789,7 @@ static int parse_part_number (void **ret_buffer, size_t *ret_buffer_len, uint16_t pkg_length; - if ((buffer_len < 0) || ((size_t) buffer_len < exp_size)) + if (buffer_len < exp_size) { WARNING ("network plugin: parse_part_number: " "Packet too short: " @@ -828,7 +828,7 @@ static int parse_part_string (void **ret_buffer, size_t *ret_buffer_len, uint16_t pkg_length; - if ((buffer_len < 0) || (buffer_len < header_size)) + if (buffer_len < header_size) { WARNING ("network plugin: parse_part_string: " "Packet too short: "