1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: use function util_parse_longlong in function string_parse_size

This commit is contained in:
Sébastien Helleu
2026-03-15 09:15:42 +01:00
parent 94e5de4836
commit 2f7f707df0
+2 -6
View File
@@ -3395,7 +3395,7 @@ unsigned long long
string_parse_size (const char *size)
{
const char *pos;
char *str_number, *error;
char *str_number;
long long number;
unsigned long long result;
@@ -3418,11 +3418,7 @@ string_parse_size (const char *size)
if (!str_number)
goto end;
error = NULL;
number = strtoll (str_number, &error, 10);
if (!error || error[0])
goto end;
if (number < 0)
if (!util_parse_longlong (str_number, 10, &number) || (number < 0))
goto end;
while (pos[0] == ' ')