summaryrefslogtreecommitdiffstats
path: root/usr.bin/leave
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1998-04-14 00:23:54 +0000
committersteve <steve@FreeBSD.org>1998-04-14 00:23:54 +0000
commite7ef89f59e3c1dadeb48e8bee050fca63d88af33 (patch)
tree1de12799072b3c06a274b86d53d92213be98b5c8 /usr.bin/leave
parent8814b5ac8b2d30397c0fa7eeb89943f36ff5f563 (diff)
downloadFreeBSD-src-e7ef89f59e3c1dadeb48e8bee050fca63d88af33.zip
FreeBSD-src-e7ef89f59e3c1dadeb48e8bee050fca63d88af33.tar.gz
Don't let secs variable wrap if <= 2.
PR: 6290 Submitted by: Ruslan Ermilov <ru@ucb.crimea.ua>
Diffstat (limited to 'usr.bin/leave')
-rw-r--r--usr.bin/leave/leave.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/leave/leave.c b/usr.bin/leave/leave.c
index 1da35da..c392696 100644
--- a/usr.bin/leave/leave.c
+++ b/usr.bin/leave/leave.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)leave.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: leave.c,v 1.2 1997/07/21 12:04:31 charnier Exp $";
+ "$Id: leave.c,v 1.3 1998/01/06 17:27:09 helbig Exp $";
#endif /* not lint */
#include <err.h>
@@ -152,7 +152,8 @@ doalarm(secs)
exit(0);
}
sleep((u_int)2); /* let parent print set message */
- secs -= 2;
+ if (secs >= 2)
+ secs -= 2;
/*
* if write fails, we've lost the terminal through someone else
OpenPOWER on IntegriCloud