diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2018-05-19 02:39:44 +0800 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2020-03-28 21:42:55 +0000 |
commit | e177d47fdffd61bdd3f4e254d73653cda5454c07 (patch) | |
tree | 8d30166fbd8599f10d1b0ef75aa80515a997b95d | |
parent | 6dc1db1bce863f0e0e0abda1b9a58d8cb22863ca (diff) | |
download | klibc-e177d47fdffd61bdd3f4e254d73653cda5454c07.tar.gz |
[klibc] dash: output: Fix fmtstr return value
[ dash commit 0e18261c159f0af3d9ea7eae116d201bc1e05dd5 ]
The function fmtstr is meant to return the actual length of output
produced, rather than the untruncated length.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | usr/dash/output.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr/dash/output.c b/usr/dash/output.c index fb6b60ab1b281..e9ee9b4d7ad8a 100644 --- a/usr/dash/output.c +++ b/usr/dash/output.c @@ -286,7 +286,7 @@ fmtstr(char *outbuf, size_t length, const char *fmt, ...) va_start(ap, fmt); ret = xvsnprintf(outbuf, length, fmt, ap); va_end(ap); - return ret; + return ret > (int)length ? length : ret; } |