summaryrefslogtreecommitdiff
path: root/ncurses/base/lib_addstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/base/lib_addstr.c')
-rw-r--r--ncurses/base/lib_addstr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ncurses/base/lib_addstr.c b/ncurses/base/lib_addstr.c
index a3753af0d53e..5bea4187f199 100644
--- a/ncurses/base/lib_addstr.c
+++ b/ncurses/base/lib_addstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019-2022,2023 Thomas E. Dickey *
+ * Copyright 2019-2024,2025 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -45,7 +45,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_addstr.c,v 1.62 2023/11/21 21:47:23 tom Exp $")
+MODULE_ID("$Id: lib_addstr.c,v 1.65 2025/02/20 08:53:36 tom Exp $")
NCURSES_EXPORT(int)
waddnstr(WINDOW *win, const char *astr, int n)
@@ -55,8 +55,8 @@ waddnstr(WINDOW *win, const char *astr, int n)
T((T_CALLED("waddnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(astr, n), n));
- if (win && (str != 0) && (n != 0)) {
- bool explicit = (n > 0);
+ if (win != NULL && str != NULL) {
+ bool explicit = (n >= 0);
TR(TRACE_VIRTPUT | TRACE_ATTRS,
("... current %s", _traceattr(WINDOW_ATTRS(win))));
@@ -123,7 +123,7 @@ NCURSES_EXPORT(int)
_nc_wchstrlen(const cchar_t *s)
{
int result = 0;
- if (s != 0) {
+ if (s != NULL) {
while (CharOf(s[result]) != L'\0') {
result++;
}
@@ -230,8 +230,8 @@ waddnwstr(WINDOW *win, const wchar_t *str, int n)
T((T_CALLED("waddnwstr(%p,%s,%d)"), (void *) win, _nc_viswbufn(str, n), n));
- if (win && (str != 0) && (n != 0)) {
- bool explicit = (n > 0);
+ if (win != NULL && str != NULL) {
+ bool explicit = (n >= 0);
TR(TRACE_VIRTPUT | TRACE_ATTRS,
("... current %s", _traceattr(WINDOW_ATTRS(win))));