-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
… able to call most functions in Curses with NULLs and just get an error code back. But if you do so, it will almost invariably indicate a bug that ought to result in bombing out so you'll know about it and fix it. Such cases should not be harmlessly elided, resulting in crashes later on that leave you scratching your head.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/* PDCurses */ | ||
|
||
#include <curspriv.h> | ||
#include <assert.h> | ||
|
||
/*man-start************************************************************** | ||
|
@@ -69,6 +70,8 @@ int waddnstr(WINDOW *win, const char *str, int n) | |
|
||
PDC_LOG(("waddnstr() - called: string=\"%s\" n %d \n", str, n)); | ||
|
||
assert( win); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Bill-Gray
Author
Owner
|
||
assert( str); | ||
if (!win || !str) | ||
return ERR; | ||
|
||
|
@@ -162,6 +165,8 @@ int waddnwstr(WINDOW *win, const wchar_t *wstr, int n) | |
|
||
PDC_LOG(("waddnwstr() - called\n")); | ||
|
||
assert( win); | ||
assert( wstr); | ||
if (!win || !wstr) | ||
return ERR; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ int flash(void) | |
|
||
PDC_LOG(("flash() - called\n")); | ||
|
||
assert( curscr); | ||
if (!curscr) | ||
return ERR; | ||
|
||
|
@Bill-Gray Isn't that duplicate now (here and in the change below) - first the assert, then the check -> ERR?