summaryrefslogtreecommitdiff
path: root/app-misc/rmlint/files/rmlint-2.10.1-x86-fix-size.patch
blob: b67c13f527ee24462f4122f326796f45771a3556 (plain)
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
30
commit 87c53a5cb0ec37412cf9fe748dc90dddc6812733
Author: Louis Sautier <sautier.louis@gmail.com>
Date:   Wed Sep 8 19:39:07 2021 +0200

    Fix max sizes on x86, closes #522
    
    strtoull returns ULLONG_MAX, not ULONG_MAX.

diff --git a/lib/cmdline.c b/lib/cmdline.c
index 56141d94..36f48c1b 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -351,7 +351,7 @@ static RmOff rm_cmd_size_string_to_bytes(const char *size_spec, GError **error)
             return 0;
         }
 
-        if(fraction_num == ULONG_MAX && errno == ERANGE) {
+        if(fraction_num == ULLONG_MAX && errno == ERANGE) {
             g_set_error(error, RM_ERROR_QUARK, 0, _("Fraction is too big for uint64"));
             return 0;
         }
@@ -371,7 +371,7 @@ static RmOff rm_cmd_size_string_to_bytes(const char *size_spec, GError **error)
             return 0;
         }
 
-        if(base_size == ULONG_MAX && errno == ERANGE) {
+        if(base_size == ULLONG_MAX && errno == ERANGE) {
             g_set_error(error, RM_ERROR_QUARK, 0, _("Size is too big for uint64"));
             return 0;
         }