1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-12-02 16:40:53 +01:00

53332, 53334: Avoid strlen calls after sprintf

This commit is contained in:
Oliver Kiddle 2025-01-30 12:30:40 +01:00
parent 4f3d69e2a0
commit f7b5cc431b
6 changed files with 27 additions and 33 deletions

View file

@ -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';