Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libcurses/director tests/libcurses: error out if c...



details:   https://anonhg.NetBSD.org/src/rev/0bd5d6362bce
branches:  trunk
changeset: 959299:0bd5d6362bce
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Feb 07 13:56:23 2021 +0000

description:
tests/libcurses: error out if called with too many arguments

This helps against users who try to add more options after the first
non-option argument and wonder why these options are silently ignored.

diffstat:

 tests/lib/libcurses/director/director.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r dd038584c42a -r 0bd5d6362bce tests/lib/libcurses/director/director.c
--- a/tests/lib/libcurses/director/director.c   Sun Feb 07 13:44:22 2021 +0000
+++ b/tests/lib/libcurses/director/director.c   Sun Feb 07 13:56:23 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: director.c,v 1.13 2021/02/07 13:44:22 rillig Exp $     */
+/*     $NetBSD: director.c,v 1.14 2021/02/07 13:56:23 rillig Exp $     */
 
 /*-
  * Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -176,7 +176,7 @@
 
        argc -= optind;
        argv += optind;
-       if (argc < 1)
+       if (argc != 1)
                usage();
 
        if (termpath == NULL)



Home | Main Index | Thread Index | Old Index