From 6fe4f3bcf9d40a051fcc98bab5c3caedeae91bd1 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Mon, 19 Jun 2006 21:51:36 +0000 Subject: [PATCH] Check for null string pointers in waddn[w]str, not just null window pointers. --- pdcurses/addstr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdcurses/addstr.c b/pdcurses/addstr.c index 04329daf..4365e9b7 100644 --- a/pdcurses/addstr.c +++ b/pdcurses/addstr.c @@ -36,7 +36,7 @@ # undef waddch #endif -RCSID("$Id: addstr.c,v 1.20 2006/06/18 18:51:46 wmcbrine Exp $"); +RCSID("$Id: addstr.c,v 1.21 2006/06/19 21:51:36 wmcbrine Exp $"); /*man-start************************************************************** @@ -118,7 +118,7 @@ int waddnstr(WINDOW *win, const char *str, int n) PDC_LOG(("waddnstr() - called: string=\"%s\" n %d \n", str, n)); - if (win == (WINDOW *)NULL) + if (win == (WINDOW *)NULL || str == (const char *)NULL) return ERR; for (ic = 0; *str && (ic < n || n < 0); ic++) @@ -205,7 +205,7 @@ int waddnwstr(WINDOW *win, const wchar_t *wstr, int n) PDC_LOG(("waddnwstr() - called\n")); - if (win == (WINDOW *)NULL) + if (win == (WINDOW *)NULL || wstr == (const wchar_t *)NULL) return ERR; for (ic = 0; *wstr && (ic < n || n < 0); ic++)