X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Ftest_add_wchstr.c;h=a7ada59ec9c9b9f55e9e9d916fa0ac708698401c;hb=e506fcb22913defb36b205cd5e84257c915d0e5e;hp=3e7f1bafcd80ab1b5a56db5a278b7811c778be78;hpb=5e1e572b71ae31a6071daa24e2460a68a6f1003c;p=ncurses.git diff --git a/test/test_add_wchstr.c b/test/test_add_wchstr.c index 3e7f1baf..a7ada59e 100644 --- a/test/test_add_wchstr.c +++ b/test/test_add_wchstr.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 2009-2016,2017 Free Software Foundation, Inc. * + * Copyright 2020,2021 Thomas E. Dickey * + * Copyright 2009-2016,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 +27,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_add_wchstr.c,v 1.26 2017/04/15 15:15:25 tom Exp $ + * $Id: test_add_wchstr.c,v 1.28 2021/03/27 23:41:34 tom Exp $ * * Demonstrate the waddwchstr() and wadd_wch functions. * Thomas Dickey - 2009/9/12 @@ -131,9 +132,10 @@ ChWLen(const wchar_t *source) if (!pass_ctls) { size_t adjust = 0; size_t n; - const char *s; for (n = 0; n < result; ++n) { + const char *s; + if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) { adjust += (strlen(s) - 1); }