diff options
Diffstat (limited to 'test/test_addchstr.c')
| -rw-r--r-- | test/test_addchstr.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/test/test_addchstr.c b/test/test_addchstr.c index cddc31528fc4..9aab678fa7e1 100644 --- a/test/test_addchstr.c +++ b/test/test_addchstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020,2022 Thomas E. Dickey * + * Copyright 2020-2024,2025 Thomas E. Dickey * * Copyright 2009-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -27,7 +27,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_addchstr.c,v 1.29 2022/12/10 22:28:50 tom Exp $ + * $Id: test_addchstr.c,v 1.32 2025/07/05 15:21:56 tom Exp $ * * Demonstrate the waddchstr() and waddch functions. * Thomas Dickey - 2009/9/12 @@ -82,7 +82,7 @@ ChLen(const char *source) for (n = 0; n < result; ++n) { const char *s = unctrl(UChar(source[n])); - if (s != 0) { + if (s != NULL) { adjust += (strlen(s) - 1); } } @@ -94,7 +94,7 @@ ChLen(const char *source) static chtype * ChStr(const char *source) { - if (source != 0) { + if (source != NULL) { size_t need = ChLen(source) + 1; int n = 0; @@ -107,7 +107,7 @@ ChStr(const char *source) do { const char *s; chtype ch = UChar(*source++); - if (!pass_ctls && (s = unctrl(ch)) != 0) { + if (!pass_ctls && (s = unctrl(ch)) != NULL) { while (*s != '\0') { temp_buffer[n++] = UChar(*s++); } @@ -116,9 +116,9 @@ ChStr(const char *source) } } while (source[0] != 0); temp_buffer[n] = 0; - } else if (temp_buffer != 0) { + } else if (temp_buffer != NULL) { free(temp_buffer); - temp_buffer = 0; + temp_buffer = NULL; temp_length = 0; } return temp_buffer; @@ -169,7 +169,7 @@ legend(WINDOW *win, int level, Options state, char *buffer, int length) } static int -ColOf(char *buffer, int length, int margin) +ColOf(const char *buffer, int length, int margin) { int n; int result; @@ -218,9 +218,9 @@ recursive_test(int level) int row2, col2; int length; char buffer[BUFSIZ]; - WINDOW *look = 0; - WINDOW *work = 0; - WINDOW *show = 0; + WINDOW *look = NULL; + WINDOW *work = NULL; + WINDOW *show = NULL; int margin = (2 * MY_TABSIZE) - 1; Options option = (Options) ((unsigned) (m_opt ? oMove @@ -509,11 +509,8 @@ main(int argc, char *argv[]) case 'w': w_opt = TRUE; break; - case OPTS_VERSION: - show_version(argv); - ExitProgram(EXIT_SUCCESS); default: - usage(ch == OPTS_USAGE); + CASE_COMMON; /* NOTREACHED */ } } |
