[前][次][番号順一覧][スレッド一覧]

ruby-changes:35909

From: nobu <ko1@a...>
Date: Fri, 17 Oct 2014 14:14:19 +0900 (JST)
Subject: [ruby-changes:35909] nobu:r47990 (trunk): signal.c: exclude terminators

nobu	2014-10-17 14:14:02 +0900 (Fri, 17 Oct 2014)

  New Revision: 47990

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47990

  Log:
    signal.c: exclude terminators
    
    * signal.c (check_reserved_signal): exclude terminator in literal
      strings.

  Modified files:
    trunk/signal.c
Index: signal.c
===================================================================
--- signal.c	(revision 47989)
+++ signal.c	(revision 47990)
@@ -865,8 +865,9 @@ check_reserved_signal(const char *name) https://github.com/ruby/ruby/blob/trunk/signal.c#L865
 
     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));

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]