summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-13 04:38:01 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-13 04:38:01 +0000
commit35c6e6af5ba2c405a91dc6b9e4af833d0979ed22 (patch)
tree7f54dda0bcda0a58eb5229def03ce3015c98a2b5 /ext
parent71d408a6c3298b229c0f1d2ff7159ca410a4c612 (diff)
str2cstr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/curses/curses.c12
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;
}