]> git.itanic.dy.fi Git - rrdd/commitdiff
onewire_parser: Avoid variable name collision
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Mon, 11 Jul 2016 11:53:34 +0000 (14:53 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Mon, 11 Jul 2016 11:53:34 +0000 (14:53 +0300)
Counter 'i' is already used by the outer while loop. Re-declaring the
varialbe would not be a problem unless we had also the print below
that expects to use the variable from the outer while loop.

Rename the inner variable to avoid conflict.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
onewire_parser.c

index 4a86ced9bdbc470410d1d850e2316ffcbd429422..eb2ccd212b490ecead3ac58587087d1cac41d1e1 100644 (file)
@@ -116,7 +116,7 @@ undefined:
                parse_opts(parser_data[i], ow_path, sizeof(ow_path), &offset);
 
                while (1) {
-                       int fail, i;
+                       int fail, j;
                        char *tmp2;
 
                        pr_info("Reading data for entry %s with offset of %.2f\n",
@@ -125,7 +125,7 @@ undefined:
 
                        /* Skip leading white space */
                        tmp2 = tmp;
-                       for (i = 0; i < ret && *tmp2 == ' '; i++)
+                       for (j = 0; j < ret && *tmp2 == ' '; j++)
                                tmp2++;
 
                        fail = !strncmp(tmp2, "85", 2);