From 59f705106700e04db22e8a8253f723c2437774c5 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Mon, 11 Jul 2016 14:53:34 +0300 Subject: [PATCH] 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 --- onewire_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.44.0