summaryrefslogtreecommitdiff
path: root/ext/curses/curses.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/curses/curses.c')
-rw-r--r--ext/curses/curses.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index ec7c6c6002..a2fbe182fa 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -333,7 +333,11 @@ curses_addstr(obj, str)
VALUE obj;
VALUE str;
{
- addstr(STR2CSTR(str));
+ char *s = STR2CSTR(str);
+
+ if (s) {
+ addstr(s);
+ }
return Qnil;
}
@@ -681,11 +685,14 @@ window_addstr(obj, str)
VALUE obj;
VALUE str;
{
- struct windata *winp;
-
- GetWINDOW(obj, winp);
- waddstr(winp->window, STR2CSTR(str));
-
+ char *s = STR2CSTR(str);
+
+ if (s) {
+ struct windata *winp;
+
+ GetWINDOW(obj, winp);
+ waddstr(winp->window, s);
+ }
return Qnil;
}