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 bug where we read the same arg...
details: https://anonhg.NetBSD.org/src/rev/69dd807892e4
branches: trunk
changeset: 768942:69dd807892e4
user: christos <christos%NetBSD.org@localhost>
date: Mon Aug 29 12:46:03 2011 +0000
description:
fix bug where we read the same argument twice. Name the timeout val the
same 'tval' in both timeout routines.
diffstat:
tests/lib/libcurses/slave/curses_commands.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diffs (48 lines):
diff -r 2bc8e6179b60 -r 69dd807892e4 tests/lib/libcurses/slave/curses_commands.c
--- a/tests/lib/libcurses/slave/curses_commands.c Mon Aug 29 12:44:35 2011 +0000
+++ b/tests/lib/libcurses/slave/curses_commands.c Mon Aug 29 12:46:03 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: curses_commands.c,v 1.4 2011/06/11 18:03:18 christos Exp $ */
+/* $NetBSD: curses_commands.c,v 1.5 2011/08/29 12:46:03 christos Exp $ */
/*-
* Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -4088,7 +4088,7 @@
return;
}
- if (sscanf(args[0], "%d", &flag) == 0) {
+ if (sscanf(args[1], "%d", &flag) == 0) {
report_count(1);
report_error("BAD ARGUMENT");
return;
@@ -5620,7 +5620,7 @@
cmd_wtimeout(int nargs, char **args)
{
WINDOW *win;
- int delay;
+ int tval;
if (check_arg_count(nargs, 2) == 1)
return;
@@ -5631,13 +5631,13 @@
return;
}
- if (sscanf(args[1], "%d", &delay) == 0) {
- report_count(1);
- report_error("BAD ARGUMENT");
- return;
- }
-
- wtimeout(win, delay); /* void return */
+ if (sscanf(args[1], "%d", &tval) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ wtimeout(win, tval); /* void return */
report_count(1);
report_return(OK);
}
Home |
Main Index |
Thread Index |
Old Index