diff options
author | Daniel Shahaf <danielsh@apache.org> | 2019-12-24 18:25:08 +0000 |
---|---|---|
committer | Daniel Shahaf <danielsh@apache.org> | 2019-12-26 04:20:24 +0000 |
commit | 8e0253af022abe9f9225352aae1088d6621a81ab (patch) | |
tree | 6466d73abcb9d1b486c98c178c4089efe52129a6 /Src | |
parent | ca6f4466e661f185d083e09c55fb93d16e0736cc (diff) | |
download | zsh-8e0253af022abe9f9225352aae1088d6621a81ab.tar.gz zsh-8e0253af022abe9f9225352aae1088d6621a81ab.tar.xz zsh-8e0253af022abe9f9225352aae1088d6621a81ab.zip |
45138: Add zformat unit tests.
Diffstat (limited to 'Src')
-rw-r--r-- | Src/Modules/zutil.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c index 24659cb16..de5fe8034 100644 --- a/Src/Modules/zutil.c +++ b/Src/Modules/zutil.c @@ -913,13 +913,13 @@ bin_zformat(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) switch (opt) { case 'f': { - char **ap, *specs[256], *out; + char **ap, *specs[256] = {0}, *out; int olen, oused = 0; - memset(specs, 0, 256 * sizeof(char *)); - specs['%'] = "%"; specs[')'] = ")"; + + /* Parse the specs in argv. */ for (ap = args + 2; *ap; ap++) { if (!ap[0][0] || ap[0][0] == '-' || ap[0][0] == '.' || idigit(ap[0][0]) || ap[0][1] != ':') { |