From 8edcffdc305b2c09a4f9b886fee12ecfc48a0e24 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Wed, 15 Feb 2012 08:25:29 +0100 Subject: cppcheck (bzr r10977) --- src/dom/xpathparser.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/dom/xpathparser.cpp') diff --git a/src/dom/xpathparser.cpp b/src/dom/xpathparser.cpp index f0e929687..393c12cda 100644 --- a/src/dom/xpathparser.cpp +++ b/src/dom/xpathparser.cpp @@ -228,16 +228,16 @@ int XPathParser::getNumber(int p0, double &dresult) { int p = p0; if (p >= parselen) + { return p0;/*need at least x*/ - + } + bool isdouble = false; - bool negative = false; int ch = parsebuf[p]; if (ch=='-') { p++; - negative = true; if (p >= parselen) return p0; } @@ -1189,18 +1189,20 @@ int XPathParser::getFunctionCall(int p0, int depth) int p = p0; if (lexTokType(p) != FUNCTION_NAME) + { return p0; - + } + DOMString name = lexTok(p).getStringValue(); p++; if (lexTokType(p) != LPAREN) //this makes a function + { return p0; + } p++; - int argCount = 0; - int p2 = getArgument(p, depth+1); if (p2 < 0) { @@ -1209,7 +1211,7 @@ int XPathParser::getFunctionCall(int p0, int depth) } if (p2 > p) { - argCount++; + int argCount = 1; p = p2; while (lexTokType(p) == COMMA) { -- cgit v1.2.3