summaryrefslogtreecommitdiff
path: root/test/test_getstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_getstr.c')
-rw-r--r--test/test_getstr.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/test_getstr.c b/test/test_getstr.c
index a086393..3f64c77 100644
--- a/test/test_getstr.c
+++ b/test/test_getstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2009,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_getstr.c,v 1.9 2009/08/29 19:02:25 tom Exp $
+ * $Id: test_getstr.c,v 1.10 2012/07/07 18:22:49 tom Exp $
*
* Author: Thomas E Dickey
*
@@ -58,6 +58,15 @@ typedef enum {
eMaxFlavor
} Flavors;
+/*
+ * Return-code is OK/ERR or a keyname.
+ */
+static const char *
+ok_keyname(int code)
+{
+ return ((code == OK) ? "OK" : ((code == ERR) ? "ERR" : keyname(code)));
+}
+
static bool
Quit(int ch)
{
@@ -310,7 +319,7 @@ test_getstr(int level, char **argv, WINDOW *strwin)
}
noecho();
(void) wattrset(txtwin, A_NORMAL);
- wprintw(strwin, "%d:%s", rc, buffer);
+ wprintw(strwin, "%s:%s", ok_keyname(rc), buffer);
wnoutrefresh(strwin);
break;
default: