]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Standard compliance fix: size_t is guaranteed unsigned.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 10 Jan 2011 14:46:21 +0000 (15:46 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 10 Jan 2011 14:46:21 +0000 (15:46 +0100)
compat/xstring.cc

index 1e8376cace7ab35f68044c95188548329803cc8f..34d2ecd8a9d5c738cc15b0888ee7a291b907a3a7 100644 (file)
@@ -61,17 +61,9 @@ xstrndup(const char *s, size_t n)
         }
         exit(1);
     }
-    if (n < 0) {
-        errno = EINVAL;
-        if (failure_notify) {
-            (*failure_notify) ("xstrndup: tried to dup a negative length string!\n");
-        } else {
-            perror("xstrndup: tried to dup a negative length string!");
-        }
-        exit(1);
-    }
 
     sz = strlen(s) + 1;
+    // size_t is unsigned, as mandated by c99 and c++ standards.
     if (sz > n)
         sz = n;