From 1bf0b804f47ee8029fe98ee449786942a10cada8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Date: Wed, 22 Feb 2017 15:04:34 +0100 Subject: [PATCH] reduce scope of variables --- qcsrc/common/util.qc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 16467f3fa..0a371ff00 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -668,7 +668,6 @@ bool isCaretEscaped(string theText, float pos) int skipIncompleteTag(string theText, float pos, int len) { - int i = 0, ch = 0; int tag_start = -1; if(substring(theText, pos - 1, 1) == "^") @@ -676,7 +675,7 @@ int skipIncompleteTag(string theText, float pos, int len) if(isCaretEscaped(theText, pos - 1) || pos >= len) return 0; - ch = str2chr(theText, pos); + int ch = str2chr(theText, pos); if(ch >= '0' && ch <= '9') return 1; // ^[0-9] color code found else if (ch == 'x') @@ -686,7 +685,7 @@ int skipIncompleteTag(string theText, float pos, int len) } else { - for(i = 2; pos - i >= 0 && i <= 4; ++i) + for(int i = 2; pos - i >= 0 && i <= 4; ++i) { if(substring(theText, pos - i, 2) == "^x") { -- 2.39.2