From 35c6e6af5ba2c405a91dc6b9e4af833d0979ed22 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 13 Jul 1998 04:38:01 +0000 Subject: str2cstr git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/curses/curses.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'ext/curses') 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; } -- cgit v1.2.3