mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-11 04:50:33 +01: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
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Reference in a new issue