mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
nm-online: fix division-by-zero with zero timeout
$ nm-online -t 0
Floating point exception (core dumped)
Fixes: c5f17a97ea
https://bugzilla.gnome.org/show_bug.cgi?id=777914
This commit is contained in:
parent
7399cf3b16
commit
34acecf544
|
@ -227,7 +227,7 @@ main (int argc, char *argv[])
|
|||
|
||||
remaining_ms = t_secs * 1000;
|
||||
data.end_timestamp_ms = data.start_timestamp_ms + remaining_ms;
|
||||
data.progress_step_duration = (data.end_timestamp_ms - data.start_timestamp_ms + PROGRESS_STEPS/2) / PROGRESS_STEPS;
|
||||
data.progress_step_duration = NM_MAX (1, (data.end_timestamp_ms - data.start_timestamp_ms + PROGRESS_STEPS/2) / PROGRESS_STEPS);
|
||||
|
||||
g_timeout_add (data.quiet ? remaining_ms : 0, handle_timeout, &data);
|
||||
nm_client_new_async (NULL, got_client, &data);
|
||||
|
|
Loading…
Reference in a new issue