aboutsummaryrefslogtreecommitdiff
path: root/test/key_names.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-02-07 08:36:41 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-02-07 08:36:41 +0000
commitf0179cb6083cc92e5947ae56e6a0a5c5328aead0 (patch)
treebcee0ba9c2149b71f0bfc036df1e61e3105bf980 /test/key_names.c
parentcea297eb34d2361e79529034397465068ae34ecd (diff)
downloadsrc-f0179cb6083cc92e5947ae56e6a0a5c5328aead0.tar.gz
src-f0179cb6083cc92e5947ae56e6a0a5c5328aead0.zip
Vendor import ncurses 6.1-20200118vendor/ncurses/6.1-20200118
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=357645 svn path=/vendor/ncurses/6.1-20200118/; revision=357646; tag=vendor/ncurses/6.1-20200118
Diffstat (limited to 'test/key_names.c')
-rw-r--r--test/key_names.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/key_names.c b/test/key_names.c
index ba45656d50a8..074a1f0ab758 100644
--- a/test/key_names.c
+++ b/test/key_names.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2014,2017 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: key_names.c,v 1.4 2008/10/11 20:22:37 tom Exp $
+ * $Id: key_names.c,v 1.7 2017/12/09 21:05:01 tom Exp $
*/
#include <test.priv.h>
@@ -77,7 +77,8 @@ main(int argc, char *argv[])
endwin();
}
for (n = -1; n < KEY_MAX + 512; n++) {
- const char *result = key_name(n);
+ int check = wcwidth((wchar_t) n);
+ const char *result = check >= 0 ? key_name((wchar_t) n) : "?";
if (result != 0)
printf("%d(%5o):%s\n", n, n, result);
}