From 725c335a375bdb076f9708127ed635f10fff3f92 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Fri, 22 May 2020 14:10:22 +0200 Subject: [PATCH] stkstring: Fixed bug in stk_fsize(). --- ucw/stkstring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.39.2