]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Francesco Chemolli <kinkie@squid-cache.org>
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 30 Jan 2011 05:46:41 +0000 (22:46 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 30 Jan 2011 05:46:41 +0000 (22:46 -0700)
Standard compliance fix: size_t is guaranteed unsigned

src/String.cci

index 050de32bba8022a8472b1ad7d585bbe6bb835887..c2c6bebeac98384bbad5b63a65abfa5568ffd2ac 100644 (file)
@@ -175,7 +175,8 @@ String::set(char const *loc, char const ch)
 void
 String::cut(String::size_type newLength)
 {
-    if (newLength < 0 || newLength > len_) return;
+    // size_type is size_t, unsigned. No need to check for newLength <0
+    if (newLength > len_) return;
 
     len_ = newLength;