summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-17 05:14:02 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-17 05:14:02 (GMT)
commitfb10a2cba5df1737f2d3080c9c6e562562fd76eb (patch)
tree8afab8c7da033d5f68a01adb23699a89ede427cb /signal.c
parentd9f3b27c1af2c338001cd85919120e98fc7eada3 (diff)
signal.c: exclude terminators
* signal.c (check_reserved_signal): exclude terminator in literal strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/signal.c b/signal.c
index 63c79ff..6d5239b 100644
--- a/signal.c
+++ b/signal.c
@@ -865,8 +865,9 @@ check_reserved_signal(const char *name)
if (prev) {
ssize_t RB_UNUSED_VAR(err);
- static const char msg1[] = " received in ";
- static const char msg2[] = " handler\n";
+#define NOZ(name, str) name[sizeof(str)-1] = str
+ static const char NOZ(msg1, " received in ");
+ static const char NOZ(msg2, " handler\n");
err = write(2, name, strlen(name));
err = write(2, msg1, sizeof(msg1));