diff options
author | ache <ache@FreeBSD.org> | 1994-10-31 04:02:31 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-10-31 04:02:31 +0000 |
commit | cc17583236592182ca8e3ea587e136728670cde3 (patch) | |
tree | 115afe490333a65e6fee8362c8433184afeb7fd3 /gnu/lib/libdialog/inputbox.c | |
parent | 669c3d9a1acb2a3f2988ea2f4ef09813cd84cab7 (diff) | |
download | FreeBSD-src-cc17583236592182ca8e3ea587e136728670cde3.zip FreeBSD-src-cc17583236592182ca8e3ea587e136728670cde3.tar.gz |
Add pointer check after each newwin/subwin with error diagnostic
Diffstat (limited to 'gnu/lib/libdialog/inputbox.c')
-rw-r--r-- | gnu/lib/libdialog/inputbox.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gnu/lib/libdialog/inputbox.c b/gnu/lib/libdialog/inputbox.c index bf423c9..8bf384d 100644 --- a/gnu/lib/libdialog/inputbox.c +++ b/gnu/lib/libdialog/inputbox.c @@ -42,6 +42,11 @@ int dialog_inputbox(unsigned char *title, unsigned char *prompt, int height, int draw_shadow(stdscr, y, x, height, width); #endif dialog = newwin(height, width, y, x); + if (dialog == NULL) { + endwin(); + fprintf(stderr, "\nnewwin(%d,%d,%d,%d) failed, maybe wrong dims\n", height,width,y,x); + exit(1); + } keypad(dialog, TRUE); draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); |