Displaying 1 result from an estimated 1 matches for "e9ee9b4d".
2020 Mar 28
0
[klibc:update-dash] dash: output: Fix fmtstr return value
...han the untruncated length.
Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/dash/output.c b/usr/dash/output.c
index fb6b60ab..e9ee9b4d 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;
}