X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/8df5b84fdf848119a9e2ba5e5a60846b6eab9886..d719927eb175a73b13a7015498e9757010344bf5:/unix/gtkwin.c diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 03f28551..2c0df9cb 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -1400,13 +1400,18 @@ void notify_remote_exit(void *frontend) static gint timer_trigger(gpointer data) { - long now = GPOINTER_TO_LONG(data); - long next; + unsigned long now = GPOINTER_TO_LONG(data); + unsigned long next, then; long ticks; if (run_timers(now, &next)) { - ticks = next - GETTICKCOUNT(); - timer_id = gtk_timeout_add(ticks > 0 ? ticks : 1, timer_trigger, + then = now; + now = GETTICKCOUNT(); + if (now - then > next - then) + ticks = 0; + else + ticks = next - now; + timer_id = gtk_timeout_add(ticks, timer_trigger, LONG_TO_GPOINTER(next)); } @@ -1417,7 +1422,7 @@ static gint timer_trigger(gpointer data) return FALSE; } -void timer_change_notify(long next) +void timer_change_notify(unsigned long next) { long ticks; @@ -3582,7 +3587,7 @@ int pt_main(int argc, char **argv) if (argc > 1 && !strncmp(argv[1], "---", 3)) { read_dupsession_data(inst, inst->conf, argv[1]); /* Splatter this argument so it doesn't clutter a ps listing */ - memset(argv[1], 0, strlen(argv[1])); + smemclr(argv[1], strlen(argv[1])); } else { /* By default, we bring up the config dialog, rather than launching * a session. This gets set to TRUE if something happens to change