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

PATCH 07/17: compresult: Remove unneeded NULL check



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