File: 08-ulonglong-printf.patch

package info (click to toggle)
unace-nonfree 2.5-10
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid, trixie
  • size: 2,044 kB
  • sloc: ansic: 14,564; makefile: 48; sh: 32; cpp: 21
file content (29 lines) | stat: -rw-r--r-- 985 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Author: Michael Karcher <debian@mkarcher.dialup.fu-berlin.de>
Description: This patch fixes a portability issue about printing big numbers.

--- unace-nonfree-2.5.orig/source/apps/exe/convert/convert.c
+++ unace-nonfree-2.5/source/apps/exe/convert/convert.c
@@ -31,7 +31,7 @@ INT       StrLen,
   ByteSize = (ByteSize / 1000000) * 100000000 + (ByteSize / 1000) * 10000
              + ByteSize % 1000;
 
-  sprintf(Str, "%lld ", ByteSize);
+  sprintf(Str, "%llu ", (unsigned long long)ByteSize);
 
   StrLen      = strlen(Str) - 1;
   Str[StrLen] = UNITCHARS[UnitCharNumber];
@@ -117,12 +117,12 @@ INT       UnitCharNumber;
 
     if (UnitCharNumber)
     {
-      sprintf(SizeStr, "%8lld ", Size);
+      sprintf(SizeStr, "%8llu ", (unsigned long long)Size);
       SizeStr[strlen(SizeStr) - 1] = UNITCHARS[UnitCharNumber];
     }
     else
     {
-      sprintf(SizeStr, "%9lld", Size);
+      sprintf(SizeStr, "%9llu", (unsigned long long)Size);
     }
   }