Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: Source/platform/DateComponents.cpp

Issue 141273002: Code problems detected by cppcheck (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/xml/XPathFunctions.cpp ('k') | Source/platform/Decimal.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/DateComponents.cpp
diff --git a/Source/platform/DateComponents.cpp b/Source/platform/DateComponents.cpp
index 62f9033dae42a2c584bd5d4223be16ba187ad4d5..a781e1c7de86715c1d754d439a7f6bd196fee523 100644
--- a/Source/platform/DateComponents.cpp
+++ b/Source/platform/DateComponents.cpp
@@ -100,7 +100,7 @@ static unsigned countDigits(const String& src, unsigned start)
// Very strict integer parser. Do not allow leading or trailing whitespace unlike charactersToIntStrict().
static bool toInt(const String& src, unsigned parseStart, unsigned parseLength, int& out)
{
- if (parseStart + parseLength > src.length() || parseLength <= 0)
+ if (parseStart + parseLength > src.length() || !parseLength)
return false;
int value = 0;
unsigned current = parseStart;
« no previous file with comments | « Source/core/xml/XPathFunctions.cpp ('k') | Source/platform/Decimal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698