]> mj.ucw.cz Git - libucw.git/commitdiff
stkstring: Fixed bug in stk_fsize().
authorPavel Charvat <pchar@ucw.cz>
Fri, 22 May 2020 12:10:22 +0000 (14:10 +0200)
committerPavel Charvat <pchar@ucw.cz>
Fri, 22 May 2020 12:10:22 +0000 (14:10 +0200)
ucw/stkstring.c

index bb3b97a0c0ce2b7b80ab0abf64e766d3bae4c9d6..10a52a08f4d94b79818545fc1c98259fe5c83a17 100644 (file)
@@ -3,7 +3,7 @@
  *
  *     (c) 2005--2007 Martin Mares <mj@ucw.cz>
  *     (c) 2005 Tomas Valla <tom@ucw.cz>
- *     (c) 2008--2019 Pavel Charvat <pchar@ucw.cz>
+ *     (c) 2008--2020 Pavel Charvat <pchar@ucw.cz>
  *
  *     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)