From 2f7f707df0bf97714d9f1f2459616f28b3a00675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 15 Mar 2026 09:15:42 +0100 Subject: [PATCH] core: use function util_parse_longlong in function string_parse_size --- src/core/core-string.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core/core-string.c b/src/core/core-string.c index 6ce8f17a1..f1926141b 100644 --- a/src/core/core-string.c +++ b/src/core/core-string.c @@ -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] == ' ')