From 7105f3a882af27b3a37d2e5b22e6555a061b7657 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 8 Feb 2015 23:40:36 +0000 Subject: in getopt() blocks, stop incrementing flag variable which are supposed to just be 0/1 ok miod florian --- usr.bin/last/last.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/last') diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 954ffbd6cfc..6df6fc915b9 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -1,4 +1,4 @@ -/* $OpenBSD: last.c,v 1.45 2015/01/16 06:40:09 deraadt Exp $ */ +/* $OpenBSD: last.c,v 1.46 2015/02/08 23:40:34 deraadt Exp $ */ /* $NetBSD: last.c,v 1.6 1994/12/24 16:49:02 cgd Exp $ */ /* @@ -112,7 +112,7 @@ main(int argc, char *argv[]) maxrec = (maxrec * 10) + (ch - '0'); break; case 'c': - calculate++; + calculate = 1; break; case 'f': file = optarg; @@ -130,7 +130,7 @@ main(int argc, char *argv[]) exit(0); break; case 's': - seconds++; + seconds = 1; break; case 't': addarg(TTY_TYPE, ttyconv(optarg)); -- cgit v1.2.3