Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH 07/17: compresult: Remove unneeded NULL check
- X-seq: zsh-workers 34121
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH 07/17: compresult: Remove unneeded NULL check
- Date: Tue, 6 Jan 2015 06:25:39 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=d2jwOyCD46RC49mnkSK5HvQX1KUztpJVmaaaSxJx8jk=; b=nJppVI7JLHMkeySonI8lGucr2RsWd2OUqOyaSLREWl7udxhQ+7jW9NmG9fPE5n+mxe ze6GtwmZXS8b+BS5tnin1UrUVxzeT2J6QyLvg73nxmWCKcSdv/NQgeYiBH2CGzHkVfYE w2bhEfwSmTKFrSBGComr8F28EU5UpWgNlNcOCp/V89h8WpFxqi1FeCZ4+NPf9PEeyJue XMcA0bgNpzfZZ9BhDTrKD2RvkaF1amxd1DmUF7Sv99doV9KUdWHCVFdab7l93Z7iOdGi PVyk2pYtMp9+zmImlXgrSsmnRB7lHFR+xE/b+BET031yAcUY7RYixIxkT090Ho1QS+XA R0HA==
- In-reply-to: <1420521949-30483-1-git-send-email-mikachu@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1420521949-30483-1-git-send-email-mikachu@gmail.com>
The variable is set to if NULL at the start of the function, and derefed
on the previous line. Found by Coverity (Issue 1255843).
---
Src/Zle/compresult.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index 93438a0..dbef7f8 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -1098,7 +1098,7 @@ do_single(Cmatch m)
} else {
p = (char *) zhalloc(strlen(prpre) + strlen(str) +
strlen(psuf) + 3);
- sprintf(p, "%s%s%s", ((prpre && *prpre) ?
+ sprintf(p, "%s%s%s", (*prpre ?
prpre : "./"), str, psuf);
}
/* And do the stat. */
--
2.2.0.GIT
Messages sorted by:
Reverse Date,
Date,
Thread,
Author