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

ruby-changes:29506

From: charliesome <ko1@a...>
Date: Sat, 22 Jun 2013 13:46:59 +0900 (JST)
Subject: [ruby-changes:29506] charliesome:r41558 (trunk): * ext/etc/etc.c (etc_getpwnam): use PRIsVALUE in format string instead

charliesome	2013-06-22 13:46:47 +0900 (Sat, 22 Jun 2013)

  New Revision: 41558

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

  Log:
    * ext/etc/etc.c (etc_getpwnam): use PRIsVALUE in format string instead
      of %s and RSTRING_PTR
    
    * ext/etc/etc.c (etc_getgrnam): ditto

  Modified files:
    trunk/ChangeLog
    trunk/ext/etc/etc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41557)
+++ ChangeLog	(revision 41558)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jun 22 13:43:00 2013  Charlie Somerville  <charliesome@r...>
+
+	* ext/etc/etc.c (etc_getpwnam): use PRIsVALUE in format string instead
+	  of %s and RSTRING_PTR
+
+	* ext/etc/etc.c (etc_getgrnam): ditto
+
 Sat Jun 22 13:07:15 2013  Tanaka Akira  <akr@f...>
 
 	* bignum.c (CLEAR_LOWBITS): Rewritten without RSHIFTX.
Index: ext/etc/etc.c
===================================================================
--- ext/etc/etc.c	(revision 41557)
+++ ext/etc/etc.c	(revision 41558)
@@ -183,7 +183,7 @@ etc_getpwnam(VALUE obj, VALUE nam) https://github.com/ruby/ruby/blob/trunk/ext/etc/etc.c#L183
 
     SafeStringValue(nam);
     pwd = getpwnam(RSTRING_PTR(nam));
-    if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %s", RSTRING_PTR(nam));
+    if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %"PRIsVALUE, nam);
     return setup_passwd(pwd);
 #else
     return Qnil;
@@ -426,7 +426,7 @@ etc_getgrnam(VALUE obj, VALUE nam) https://github.com/ruby/ruby/blob/trunk/ext/etc/etc.c#L426
 
     SafeStringValue(nam);
     grp = getgrnam(RSTRING_PTR(nam));
-    if (grp == 0) rb_raise(rb_eArgError, "can't find group for %s", RSTRING_PTR(nam));
+    if (grp == 0) rb_raise(rb_eArgError, "can't find group for %"PRIsVALUE, nam);
     return setup_group(grp);
 #else
     return Qnil;

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

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