summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRenaud Barbier <renaud.barbier@ge.com>2016-04-08 10:16:10 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-12 08:05:35 +0200
commit97e553bc657efcb99b6a99fe93fd3b06d7f0f82a (patch)
treeba9e398b1ac8a86bbb0527e4a0c5fd9632e72788 /lib
parent45ad47a30190fdeb6602835f71dd5bb076695315 (diff)
downloadbarebox-97e553bc657efcb99b6a99fe93fd3b06d7f0f82a.tar.gz
barebox-97e553bc657efcb99b6a99fe93fd3b06d7f0f82a.tar.xz
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/display_options.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/display_options.c b/lib/display_options.c
index 2d695e4b7c..0f65f5972e 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -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'};