diff options
author | phk <phk@FreeBSD.org> | 2001-06-05 21:04:42 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-06-05 21:04:42 +0000 |
commit | 0c609abe71b85c6c5dc3d0b759c5a33ad845cef8 (patch) | |
tree | dfdf60bf7436aa206b8b37223df2a34196dec0a9 /usr.bin/logname | |
parent | b58cdc4c790e70db83416ab57abf58b7237c6b30 (diff) | |
download | FreeBSD-src-0c609abe71b85c6c5dc3d0b759c5a33ad845cef8.zip FreeBSD-src-0c609abe71b85c6c5dc3d0b759c5a33ad845cef8.tar.gz |
There is no reason for logname to call getopt(3), it doesn't take
any options.
PR: 26689
Submitted by: FĂ©lix-Antoine Paradis <reel@sympatico.ca>
Diffstat (limited to 'usr.bin/logname')
-rw-r--r-- | usr.bin/logname/logname.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/usr.bin/logname/logname.c b/usr.bin/logname/logname.c index c0f016e..30bd41c 100644 --- a/usr.bin/logname/logname.c +++ b/usr.bin/logname/logname.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #ifndef lint @@ -55,18 +57,10 @@ main(argc, argv) int argc; char *argv[]; { - int ch; char *p; - while ((ch = getopt(argc, argv, "")) != -1) - switch (ch) { - case '?': - default: - usage(); - } - argc -= optind; - argv += optind; - + if (argc != 1) + usage(); if ((p = getlogin()) == NULL) err(1, NULL); (void)printf("%s\n", p); |