mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 06:20:10 +01:00
shared: use nm_str_skip_leading_spaces() in _nm_utils_ascii_str_to_int64()
(cherry picked from commit 9d2623cceb)
This commit is contained in:
parent
4be7cf71e0
commit
84bd35e4fa
1 changed files with 3 additions and 6 deletions
|
|
@ -734,10 +734,7 @@ _nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 ma
|
|||
gint64 v;
|
||||
const char *s = NULL;
|
||||
|
||||
if (str) {
|
||||
while (g_ascii_isspace (str[0]))
|
||||
str++;
|
||||
}
|
||||
str = nm_str_skip_leading_spaces (str);
|
||||
if (!str || !str[0]) {
|
||||
errno = EINVAL;
|
||||
return fallback;
|
||||
|
|
@ -748,9 +745,9 @@ _nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 ma
|
|||
|
||||
if (errno != 0)
|
||||
return fallback;
|
||||
|
||||
if (s[0] != '\0') {
|
||||
while (g_ascii_isspace (s[0]))
|
||||
s++;
|
||||
s = nm_str_skip_leading_spaces (s);
|
||||
if (s[0] != '\0') {
|
||||
errno = EINVAL;
|
||||
return fallback;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue