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

ruby-changes:28291

From: naruse <ko1@a...>
Date: Thu, 18 Apr 2013 15:11:41 +0900 (JST)
Subject: [ruby-changes:28291] naruse:r40343 (trunk): Increase capacity for skipping paddings

naruse	2013-04-18 15:11:31 +0900 (Thu, 18 Apr 2013)

  New Revision: 40343

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

  Log:
    Increase capacity for skipping paddings
    
    fix for r40342

  Modified files:
    trunk/pack.c

Index: pack.c
===================================================================
--- pack.c	(revision 40342)
+++ pack.c	(revision 40343)
@@ -1941,7 +1941,7 @@ pack_unpack(VALUE str, VALUE fmt) https://github.com/ruby/ruby/blob/trunk/pack.c#L1941
 
 	  case 'm':
 	    {
-		VALUE buf = infected_str_new(0, (send - s)*3/4, str);
+		VALUE buf = infected_str_new(0, (send - s + 2)*3/4, str); /* +2 is for skipping paddings */
 		char *ptr = RSTRING_PTR(buf);
 		int a = -1,b = -1,c = 0,d = 0;
 		static signed char b64_xtable[256];

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

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