From b2a3f5b114c332cf80cb83c96f599b73833bf6e1 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 18 Nov 2014 15:51:41 +0100 Subject: [PATCH] Terminal: initialize some variables This is harmless, the sequence of states ensures they would be initialized when needed anyway, but Coverity decides otherwise. Fixes #10131 / CID743879. --- src/apps/terminal/TermParse.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/apps/terminal/TermParse.cpp b/src/apps/terminal/TermParse.cpp index d22ef38154..25d0a4369a 100644 --- a/src/apps/terminal/TermParse.cpp +++ b/src/apps/terminal/TermParse.cpp @@ -362,8 +362,8 @@ TermParse::_GuessGroundTable(int encoding) int32 TermParse::EscParse() { - int top; - int bottom; + int top = 0; + int bottom = 0; char cbuf[4] = { 0 }; char dstbuf[4] = { 0 }; @@ -372,9 +372,11 @@ TermParse::EscParse() int param[NPARAM]; int nparam = 1; + for (int i = 0; i < NPARAM; i++) + param[i] = DEFAULT; - int row; - int column; + int row = 0; + int column = 0; // default encoding system is UTF8 int *groundtable = gUTF8GroundTable;