From 3c71863c05c3e81716af78af9b5ea77334c03bb1 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 3 Oct 2013 11:16:54 +0200 Subject: [PATCH] inp_fix_ternary_operator_str(), local scope for `count' --- src/frontend/inpcom.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index e990b813e..ca638a260 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1797,7 +1797,6 @@ inp_fix_ternary_operator_str(char *line, bool all) { char *conditional, *if_str, *else_str, *question, *colon, keep, *str_ptr, *str_ptr2, *str_ptr3, *new_str; char *end_str = NULL, *beg_str = NULL; - int count = 0; if (!strchr(line, '?') && !strchr(line, ':')) return line; @@ -1837,7 +1836,7 @@ inp_fix_ternary_operator_str(char *line, bool all) str_ptr2 = skip_back_ws(question); /* test for (conditional)?... */ if (str_ptr2[-1] == ')') { - count = 1; + int count = 1; str_ptr = str_ptr2 - 1; while ((count != 0) && (str_ptr != line)) { str_ptr--; @@ -1873,7 +1872,7 @@ inp_fix_ternary_operator_str(char *line, bool all) str_ptr = skip_ws(question + 1); if (*str_ptr == '(') { // find closing paren - count = 1; + int count = 1; str_ptr2 = str_ptr/* + 1*/; while (count != 0 && *str_ptr2 != '\0') { str_ptr2++; @@ -1911,7 +1910,7 @@ inp_fix_ternary_operator_str(char *line, bool all) if (*str_ptr == '(') { // find end paren ')' bool found_paren = FALSE; - count = 0; + int count = 0; str_ptr2 = str_ptr; while (*str_ptr2 != '\0') { if (*str_ptr2 == '(') {