From ce57f0cafcd076db9aaaf70a8d547ac72d011e2f Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 17 Aug 2012 19:57:31 +1000 Subject: Ensure variable NUL terminated and limit its scope. Avoids warning from Visual C++ code analysis. --- lexers/LexLua.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lexers/LexLua.cxx b/lexers/LexLua.cxx index 9e48efcd9..4277d87a5 100644 --- a/lexers/LexLua.cxx +++ b/lexers/LexLua.cxx @@ -374,7 +374,6 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W char chNext = styler[startPos]; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; int styleNext = styler.StyleAt(startPos); - char s[10]; for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; @@ -384,6 +383,7 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_LUA_WORD) { if (ch == 'i' || ch == 'd' || ch == 'f' || ch == 'e' || ch == 'r' || ch == 'u') { + char s[10] = ""; for (unsigned int j = 0; j < 8; j++) { if (!iswordchar(styler[i + j])) { break; -- cgit v1.2.3