From: Ruben Kerkhof Date: Sat, 12 Mar 2016 16:30:58 +0000 (+0100) Subject: onewire plugin: fix two compiler warnings X-Git-Tag: collectd-5.6.0~387 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9d5c9e04aac3689f49098cba0e630128c0ef4caa;p=collectd.git onewire plugin: fix two compiler warnings onewire.c:418:31: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] if ((status > 0) && (status < sizeof (subpath))) ~~~~~~ ^ ~~~~~~~~~~~~~~~~ onewire.c:422:31: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] if ((status > 0) && (status < sizeof (subpath))) ~~~~~~ ^ ~~~~~~~~~~~~~~~~ --- diff --git a/src/onewire.c b/src/onewire.c index 58c35e1e..3c3afdf6 100644 --- a/src/onewire.c +++ b/src/onewire.c @@ -415,11 +415,11 @@ static int cow_read_ds2409 (const char *path) int status; status = ssnprintf (subpath, sizeof (subpath), "%s/main", path); - if ((status > 0) && (status < sizeof (subpath))) + if ((status > 0) && (status < (int) sizeof (subpath))) cow_read_bus (subpath); status = ssnprintf (subpath, sizeof (subpath), "%s/aux", path); - if ((status > 0) && (status < sizeof (subpath))) + if ((status > 0) && (status < (int) sizeof (subpath))) cow_read_bus (subpath); return (0);