X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/bc06669bcf2c0d331e231d18c0e14023433f9e79..bcb1823f2c7cb3e886e54c6932ff2c37731d8ab8:/windows/winplink.c diff --git a/windows/winplink.c b/windows/winplink.c index 58063352..0abed7ce 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -289,7 +289,7 @@ int main(int argc, char **argv) int errors; int got_host = FALSE; int use_subsystem = 0; - long now, next; + unsigned long now, next, then; sklist = NULL; skcount = sksize = 0; @@ -343,8 +343,10 @@ int main(int argc, char **argv) } else if (!strcmp(p, "-s")) { /* Save status to write to conf later. */ use_subsystem = 1; - } else if (!strcmp(p, "-V")) { + } else if (!strcmp(p, "-V") || !strcmp(p, "--version")) { version(); + } else if (!strcmp(p, "--help")) { + usage(); } else if (!strcmp(p, "-pgpfp")) { pgp_fingerprints(); exit(1); @@ -634,8 +636,12 @@ int main(int argc, char **argv) } if (run_timers(now, &next)) { - ticks = next - GETTICKCOUNT(); - if (ticks < 0) ticks = 0; /* just in case */ + then = now; + now = GETTICKCOUNT(); + if (now - then > next - then) + ticks = 0; + else + ticks = next - now; } else { ticks = INFINITE; }