From c31cac93f3695b81383e65ecc8206fbda7f75d94 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sat, 6 Aug 2011 10:51:57 +0200 Subject: misc: Fix ssh_timeout_update(). --- src/misc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/misc.c') diff --git a/src/misc.c b/src/misc.c index 0e08fa2..361fc2d 100644 --- a/src/misc.c +++ b/src/misc.c @@ -940,15 +940,15 @@ int ssh_timeout_elapsed(struct ssh_timestamp *ts, int timeout) { * @param[in] ts pointer to an existing timestamp * @param[in] timeout timeout in milliseconds. Negative values mean infinite * timeout - * @returns remaining time in milliseconds, 0 if elapsed, -1 if never. + * @returns remaining time in milliseconds, 0 if elapsed, -1 if never, + * -2 if option-set-timeout. */ int ssh_timeout_update(struct ssh_timestamp *ts, int timeout){ struct ssh_timestamp now; int ms, ret; - if(timeout == 0) - return 0; - if(timeout==-1) - return -1; + if (timeout <= 0) { + return timeout; + } ssh_timestamp_init(&now); ms = ssh_timestamp_difference(ts,&now); if(ms < 0) -- cgit