about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2005-06-17 08:37:46 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2005-06-17 08:37:46 +0000
commit14bfaab3efce9e76bfe589a4a6c000bffe6e1f1b (patch)
tree28430ca7ced95ad3d643c3206b1662e655d711b8
parent2a176ec84ed588b10ff427901011826ea4712f23 (diff)
downloadzsh-14bfaab3efce9e76bfe589a4a6c000bffe6e1f1b.tar.gz
zsh-14bfaab3efce9e76bfe589a4a6c000bffe6e1f1b.tar.xz
zsh-14bfaab3efce9e76bfe589a4a6c000bffe6e1f1b.zip
21352: Harald van Dijk: handle null after % in printf format specifier
-rw-r--r--Src/builtin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 6bec738f4..48e836996 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3653,7 +3653,7 @@ bin_print(char *name, char **args, Options ops, int func)
 	    
 	    /* copy only one of each flag as spec has finite size */
 	    memset(flags, 0, sizeof(flags));
-	    while ((flag = strchr(flagch, *c))) {
+	    while (*c && (flag = strchr(flagch, *c))) {
 	    	if (!flags[flag - flagch]) {
 	    	    flags[flag - flagch] = 1;
 		    *d++ = *c;