ash: output: Fix fmtstr return value
Upstream commit: Date: Sat, 19 May 2018 02:39:44 +0800 output: Fix fmtstr return value 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: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
970470e235
commit
3f7fb2c89a
@ -713,7 +713,7 @@ fmtstr(char *outbuf, size_t length, const char *fmt, ...)
|
|||||||
ret = vsnprintf(outbuf, length, fmt, ap);
|
ret = vsnprintf(outbuf, length, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
INT_ON;
|
INT_ON;
|
||||||
return ret;
|
return ret > (int)length ? length : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user