summaryrefslogtreecommitdiff
path: root/ncurses/base/lib_instr.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/base/lib_instr.c')
-rw-r--r--ncurses/base/lib_instr.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ncurses/base/lib_instr.c b/ncurses/base/lib_instr.c
index 221ebd290400..c9016b659a6f 100644
--- a/ncurses/base/lib_instr.c
+++ b/ncurses/base/lib_instr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020-2021,2023 Thomas E. Dickey *
+ * Copyright 2020-2023,2024 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -42,7 +42,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_instr.c,v 1.26 2023/06/03 12:37:04 tom Exp $")
+MODULE_ID("$Id: lib_instr.c,v 1.28 2024/12/07 17:53:39 tom Exp $")
NCURSES_EXPORT(int)
winnstr(WINDOW *win, char *str, int n)
@@ -63,7 +63,7 @@ winnstr(WINDOW *win, char *str, int n)
for (; i < n;) {
#if USE_WIDEC_SUPPORT
- cchar_t *cell = &(text[col]);
+ const cchar_t *cell = &(text[col]);
attr_t attrs;
NCURSES_PAIRS_T pair;
char *tmp;
@@ -72,17 +72,17 @@ winnstr(WINDOW *win, char *str, int n)
wchar_t *wch;
int n2;
- n2 = getcchar(cell, 0, 0, 0, 0);
+ n2 = getcchar(cell, NULL, NULL, NULL, NULL);
if (n2 > 0
- && (wch = typeCalloc(wchar_t, (unsigned) n2 + 1)) != 0) {
+ && (wch = typeCalloc(wchar_t, (unsigned) n2 + 1)) != NULL) {
bool done = FALSE;
- if (getcchar(cell, wch, &attrs, &pair, 0) == OK) {
+ if (getcchar(cell, wch, &attrs, &pair, NULL) == OK) {
mbstate_t state;
size_t n3;
init_mb(state);
- n3 = wcstombs(0, wch, (size_t) 0);
+ n3 = wcstombs(NULL, wch, (size_t) 0);
if (!isEILSEQ(n3) && (n3 != 0) && (n3 <= MB_LEN_MAX)) {
size_t need = n3 + 10 + (size_t) i;
int have = (int) n3 + i;
@@ -90,7 +90,7 @@ winnstr(WINDOW *win, char *str, int n)
/* check for loop-done as well as overflow */
if (have > n || (int) need <= 0) {
done = TRUE;
- } else if ((tmp = typeCalloc(char, need)) == 0) {
+ } else if ((tmp = typeCalloc(char, need)) == NULL) {
done = TRUE;
} else {
size_t i3;