From: nobu.nokada@... Date: 2002-08-28T03:56:17+09:00 Subject: Re: [Safer] rb_class_path Hi, At Wed, 28 Aug 2002 01:05:55 +0900, Michal Rokos wrote: > - sprintf(buf, "#<%s:0x%lx>", s, klass); > - return rb_str_new2(buf); + str = rb_str_new(0, 2 + strlen(s) + 3 + SIZEOF_LONG * 2 + 1 + 1); > + snprintf(RSTRING(str)->ptr, RSTRING(str)->len, "#<%s:0x%lx>", s, klass); + RSTRING(str)->len = strlen(RSTRING(str)->ptr); > + > + return str; > } > } -- Nobu Nakada