Don't let secs variable wrap if <= 2.

PR:		6290
Submitted by:	Ruslan Ermilov <ru@ucb.crimea.ua>
This commit is contained in:
Steve Price 1998-04-14 00:23:54 +00:00
parent 83898438e1
commit 2a453c238f

View File

@ -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