diff options
| author | Oliver Kiddle <opk@zsh.org> | 2025-01-30 12:30:40 +0100 |
|---|---|---|
| committer | Oliver Kiddle <opk@zsh.org> | 2025-01-30 12:30:40 +0100 |
| commit | f7b5cc431bdda1f7123aca740bf7c535b98ca616 (patch) | |
| tree | 4cdf1304b1a709b8ed7ae8284e334098b3df3921 /Src/Modules/stat.c | |
| parent | 53329: adapt .zle.sgr for CSI sequences that use : instead of ; (diff) | |
| download | zsh-f7b5cc431bdda1f7123aca740bf7c535b98ca616.tar zsh-f7b5cc431bdda1f7123aca740bf7c535b98ca616.tar.gz zsh-f7b5cc431bdda1f7123aca740bf7c535b98ca616.tar.bz2 zsh-f7b5cc431bdda1f7123aca740bf7c535b98ca616.tar.lz zsh-f7b5cc431bdda1f7123aca740bf7c535b98ca616.tar.xz zsh-f7b5cc431bdda1f7123aca740bf7c535b98ca616.tar.zst zsh-f7b5cc431bdda1f7123aca740bf7c535b98ca616.zip | |
53332, 53334: Avoid strlen calls after sprintf
Diffstat (limited to 'Src/Modules/stat.c')
| -rw-r--r-- | Src/Modules/stat.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Src/Modules/stat.c b/Src/Modules/stat.c index c9f851974..5bf201dd3 100644 --- a/Src/Modules/stat.c +++ b/Src/Modules/stat.c @@ -236,9 +236,8 @@ statprint(struct stat *sbuf, char *outbuf, char *fname, int iwhich, int flags) char *optr = outbuf; if (flags & STF_NAME) { - sprintf(outbuf, (flags & (STF_PICK|STF_ARRAY)) ? + optr += sprintf(outbuf, (flags & (STF_PICK|STF_ARRAY)) ? "%s " : "%-8s", statelts[iwhich]); - optr += strlen(outbuf); } *optr = '\0'; |
