diff options
author | Ray Strode <halfline@gmail.com> | 2021-09-21 14:40:01 +0000 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2021-09-21 14:40:01 +0000 |
commit | 8ff8a78a35d0ea27deb06c560d1b24ea1587f712 (patch) | |
tree | 67690ecdf37f16abce24b60dc21df7dc5877b48b | |
parent | e55447500fa95a0cc59c741296030ed91a2986dc (diff) | |
parent | 07458698b1a42395e18129d72b648f7e9c5373cd (diff) |
Merge branch 'master' into 'master'
main: Ensure that doubles in config files are parsed with '.'
Closes #153
See merge request plymouth/plymouth!144
-rw-r--r-- | src/main.c | 25 |
1 files changed, 5 insertions, 20 deletions
@@ -294,28 +294,13 @@ load_settings (state_t *state, } if (isnan (state->splash_delay)) { - char *delay_string; - - delay_string = ply_key_file_get_value (key_file, "Daemon", "ShowDelay"); - - if (delay_string != NULL) { - state->splash_delay = atof (delay_string); - ply_trace ("Splash delay is set to %lf", state->splash_delay); - free (delay_string); - } + state->splash_delay = ply_key_file_get_double(key_file, "Daemon", "ShowDelay", NAN); + ply_trace ("Splash delay is set to %lf", state->splash_delay); } if (isnan (state->device_timeout)) { - char *timeout_string; - - timeout_string = ply_key_file_get_value (key_file, "Daemon", "DeviceTimeout"); - - if (timeout_string != NULL) { - state->device_timeout = atof (timeout_string); - ply_trace ("Device timeout is set to %lf", state->device_timeout); - - free (timeout_string); - } + state->device_timeout = ply_key_file_get_double(key_file, "Daemon", "DeviceTimeout", NAN); + ply_trace ("Device timeout is set to %lf", state->device_timeout); } scale_string = ply_key_file_get_value (key_file, "Daemon", "DeviceScale"); @@ -391,7 +376,7 @@ find_override_splash (state_t *state) delay_string = ply_kernel_command_line_get_string_after_prefix ("plymouth.splash-delay="); if (delay_string != NULL) - state->splash_delay = atof (delay_string); + state->splash_delay = ply_strtod (delay_string); } } |