mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-30 00:00:31 +01:00
ifcfg: strip whitespaces around "DEVTIMEOUT"
Be more graceful and allow whitespaces around the floating point number for DEVTIMEOUT. Note that _nm_utils_ascii_str_to_int64() is already graceful against whitespace, so also be it with the g_ascii_strtod() code path. (cherry picked from commit2e4771be5e) (cherry picked from commit5a44792e41)
This commit is contained in:
parent
75933cd6ff
commit
396a4dfc2b
1 changed files with 4 additions and 2 deletions
|
|
@ -543,16 +543,18 @@ make_connection_setting (const char *file,
|
|||
g_object_set (s_con, NM_SETTING_CONNECTION_AUTH_RETRIES, (int) vint64, NULL);
|
||||
|
||||
nm_clear_g_free (&value);
|
||||
v = svGetValueStr (ifcfg, "DEVTIMEOUT", &value);
|
||||
v = svGetValue (ifcfg, "DEVTIMEOUT", &value);
|
||||
if (v) {
|
||||
v = nm_str_skip_leading_spaces (v);
|
||||
vint64 = _nm_utils_ascii_str_to_int64 (v, 10, 0, ((gint64) G_MAXINT32) / 1000, -1);
|
||||
if (vint64 != -1)
|
||||
vint64 *= 1000;
|
||||
else {
|
||||
else if (v[0] != '\0') {
|
||||
char *endptr;
|
||||
double d;
|
||||
|
||||
d = g_ascii_strtod (v, &endptr);
|
||||
endptr = nm_str_skip_leading_spaces (endptr);
|
||||
if ( errno == 0
|
||||
&& endptr[0] == '\0'
|
||||
&& d >= 0.0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue