Skip to content

Commit

Permalink
Fix max sizes on x86, closes sahib#522
Browse files Browse the repository at this point in the history
strtoull returns ULLONG_MAX, not ULONG_MAX.
  • Loading branch information
sbraz committed Sep 8, 2021
1 parent 29bd07e commit 87c53a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 87c53a5

Please sign in to comment.