From: Pavel Charvat Date: Fri, 22 May 2020 12:10:22 +0000 (+0200) Subject: stkstring: Fixed bug in stk_fsize(). X-Git-Tag: v6.5.13~4 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=725c335a375bdb076f9708127ed635f10fff3f92;p=libucw.git stkstring: Fixed bug in stk_fsize(). --- diff --git a/ucw/stkstring.c b/ucw/stkstring.c index bb3b97a0..10a52a08 100644 --- a/ucw/stkstring.c +++ b/ucw/stkstring.c @@ -3,7 +3,7 @@ * * (c) 2005--2007 Martin Mares * (c) 2005 Tomas Valla - * (c) 2008--2019 Pavel Charvat + * (c) 2008--2020 Pavel Charvat * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -106,7 +106,7 @@ stk_fsize_internal(char *buf, u64 x) else if (x < (u64)10<<30) sprintf(buf, "%.1fG", (double)x/(1<<30)); else if (x < (u64)1<<40) - sprintf(buf, "%dG", (int)x/(1<<30)); + sprintf(buf, "%dG", (int)(x/(1<<30))); else if (x < (u64)10<<40) sprintf(buf, "%.1fT", (double)x/((u64)1<<40)); else if (x != ~(u64)0)