Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libcurses/slave Fix argument parsing for mvinsch, ...



details:   https://anonhg.NetBSD.org/src/rev/c5e45e8aacbf
branches:  trunk
changeset: 456165:c5e45e8aacbf
user:      blymn <blymn%NetBSD.org@localhost>
date:      Fri Apr 26 02:46:00 2019 +0000

description:
Fix argument parsing for mvinsch, last arg is a chtype not a string.

diffstat:

 tests/lib/libcurses/slave/curses_commands.c |  17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diffs (38 lines):

diff -r ba5a41eb415a -r c5e45e8aacbf tests/lib/libcurses/slave/curses_commands.c
--- a/tests/lib/libcurses/slave/curses_commands.c       Fri Apr 26 01:51:55 2019 +0000
+++ b/tests/lib/libcurses/slave/curses_commands.c       Fri Apr 26 02:46:00 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: curses_commands.c,v 1.7 2012/09/19 11:51:08 blymn Exp $        */
+/*     $NetBSD: curses_commands.c,v 1.8 2019/04/26 02:46:00 blymn Exp $        */
 
 /*-
  * Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -1274,7 +1274,8 @@
 void
 cmd_mvinsch(int nargs, char **args)
 {
-       int y, x, ch;
+       int y, x;
+       chtype *ch;
 
        if (check_arg_count(nargs, 3) == 1)
                return;
@@ -1291,14 +1292,10 @@
                return;
        }
 
-       if (sscanf(args[2], "%d", &ch) == 0) {
-               report_count(1);
-               report_error("BAD ARGUMENT");
-               return;
-       }
-
-       report_count(1);
-       report_return(mvinsch(y, x, ch));
+       ch = (chtype *) args[2];
+
+       report_count(1);
+       report_return(mvinsch(y, x, ch[0]));
 }
 
 



Home | Main Index | Thread Index | Old Index