diff options
Diffstat (limited to 'ext/curses/curses.c')
-rw-r--r-- | ext/curses/curses.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c index a2fbe182fa..69b5636a25 100644 --- a/ext/curses/curses.c +++ b/ext/curses/curses.c @@ -333,10 +333,8 @@ curses_addstr(obj, str) VALUE obj; VALUE str; { - char *s = STR2CSTR(str); - - if (s) { - addstr(s); + if (!NIL_P(str)) { + addstr(STR2CSTR(str)); } return Qnil; } @@ -685,13 +683,11 @@ window_addstr(obj, str) VALUE obj; VALUE str; { - char *s = STR2CSTR(str); - - if (s) { + if (!NIL_P(str)) { struct windata *winp; GetWINDOW(obj, winp); - waddstr(winp->window, s); + waddstr(winp->window, STR2CSTR(str)); } return Qnil; } |