From: octo Date: Sun, 19 Feb 2006 09:33:58 +0000 (+0000) Subject: Fixed the comparsion using `strcmp' X-Git-Tag: collectd-3.8.0~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=635f3a046455330659a742556514f6b4f219443c;p=collectd.git Fixed the comparsion using `strcmp' --- diff --git a/src/battery.c b/src/battery.c index 6c7e2b50..ab5a0424 100644 --- a/src/battery.c +++ b/src/battery.c @@ -285,20 +285,20 @@ static void battery_read (void) if (numfields < 3) continue; - if ((strcmp (fields[0], "present")) - && (strcmp (fields[1], "rate:"))) + if ((strcmp (fields[0], "present") == 0) + && (strcmp (fields[1], "rate:") == 0)) valptr = ¤t; - else if ((strcmp (fields[0], "remaining")) - && (strcmp (fields[1], "capacity:"))) + else if ((strcmp (fields[0], "remaining") == 0) + && (strcmp (fields[1], "capacity:") == 0)) valptr = &charge; - else if ((strcmp (fields[0], "present")) - && (strcmp (fields[1], "voltage:"))) + else if ((strcmp (fields[0], "present") == 0) + && (strcmp (fields[1], "voltage:") == 0)) valptr = &voltage; else valptr = NULL; - if ((strcmp (fields[0], "charging")) - && (strcmp (fields[1], "state:"))) + if ((strcmp (fields[0], "charging") == 0) + && (strcmp (fields[1], "state:") == 0)) { if (strcmp (fields[2], "charging")) charging = 1;