From: Timo Kokkonen Date: Mon, 11 Jul 2016 11:53:34 +0000 (+0300) Subject: onewire_parser: Avoid variable name collision X-Git-Url: http://git.itanic.dy.fi/?p=rrdd;a=commitdiff_plain;h=59f705106700e04db22e8a8253f723c2437774c5 onewire_parser: Avoid variable name collision 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 --- diff --git a/onewire_parser.c b/onewire_parser.c index 4a86ced..eb2ccd2 100644 --- a/onewire_parser.c +++ b/onewire_parser.c @@ -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);