9
0
Fork 0

lib: declared buffer is too small to hold string

Displaying an unsigned 64-bit integer can be represented by up to 20
characters. The 20 bytes buffer reserved to store the formatted string
"%llu Bytes" is to small: (20 + 6) = 26. Hence, a bigger buffer is reserved
to hold this string.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Renaud Barbier 2016-04-08 10:16:10 +01:00 committed by Sascha Hauer
parent 45ad47a301
commit 97e553bc65
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@
*/
char *size_human_readable(unsigned long long size)
{
static char buf[20];
static char buf[30];
unsigned long m = 0, n;
unsigned long long f;
static const char names[] = {'E', 'P', 'T', 'G', 'M', 'K'};