Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: remove dead code flagged by coverity



Coverity correctly flags these two lines of code as being dead. This was
added in 42332. Unless the intention was instead for zstrtoul_underscore() to
also handle base#number syntax then this can go because it only looks
for binary, octal, decimal and hex.

Oliver

diff --git a/Src/utils.c b/Src/utils.c
index 3587c3622..c544b81bf 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2486,9 +2486,7 @@ zstrtoul_underscore(const char *s, zulong *retval)
 	base = 2, s++;
     else
 	base = isset(OCTALZEROES) ? 8 : 10;
-    if (base < 2 || base > 36) {
-	return 0;
-    } else if (base <= 10) {
+    if (base <= 10) {
 	for (; (*s >= '0' && *s < ('0' + base)) ||
 		 *s == '_'; s++) {
 	    if (*s == '_')



Messages sorted by: Reverse Date, Date, Thread, Author