summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-02 04:04:30 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-02 04:04:30 (GMT)
commit76d1d5269f72e72e8fb39877bb1850aca823158d (patch)
tree893db691c0b42bfb7d8643ed8b4929123c5df741 /signal.c
parentba536e41549f694d5c7434edb967ee571b2161c2 (diff)
signal.c: nil for invalid signum
* signal.c (sig_signame): return nil if the argument is a valid signal number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/signal.c b/signal.c
index fcfed8d..53e77d9 100644
--- a/signal.c
+++ b/signal.c
@@ -257,6 +257,7 @@ static VALUE
sig_signame(VALUE recv, VALUE signo)
{
const char *signame = signo2signm(NUM2INT(signo));
+ if (!signame) return Qnil;
return rb_str_new_cstr(signame);
}