Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: remove dead code flagged by coverity
- X-seq: zsh-workers 42595
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: remove dead code flagged by coverity
- Date: Thu, 05 Apr 2018 14:09:06 +0200
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1522930149; bh=f0DfDHMXyXmSHTskp8DLSdRRdpx+7xzcQ0TrY/nFfUw=; h=From:To:Subject:Date:From:Subject; b=ZOio0oVO0ClzIy3/axjfaIVepcOrR/nSaGMUlJ9smHo+FczZnGVUg6zecu8s+u8SYOQtoNrVrNm2ajGXJajBbUdzoDevUTRpFp8/FRNsiwLZWsgiKonsd2aDIkyyWrGgsQfjkf8qekiu8PQdzddOzkbD307PmBiozKyqvyX2IWiKAiOhpWOXXhmNZHNFPZSEUwAP3hd4ugde2pLZ+K2+413wmG2NaG6T2GH6osDG2R5SX8g2SWODcHhDljNI4lqStEfa2VpmlH3T6CfuMNYhjTirurQFQBAvIxsXkqLuNfhSXOfa+p+2o/mpcPnFhXQKso1J0Kc3yeLFNhEfbXQNgg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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