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 | 4f3d69e2a0bc6b4d98a4aa3ef37ebea44cbda51f (diff) | |
download | zsh-f7b5cc431bdda1f7123aca740bf7c535b98ca616.tar.gz 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'; |