From: nagachika00@... Date: 2014-06-29T17:17:45+00:00 Subject: [ruby-core:63402] [ruby-trunk - Bug #9861] BSD_vfprintf precsion doesn't work at shorter string Issue #9861 has been updated by Tomoyuki Chikanaga. Backport changed from 2.0.0: DONE, 2.1: REQUIRED to 2.0.0: DONE, 2.1: DONE Backported into `ruby_2_1` branch at r46611. ---------------------------------------- Bug #9861: BSD_vfprintf precsion doesn't work at shorter string https://bugs.ruby-lang.org/issues/9861#change-47445 * Author: Nobuyoshi Nakada * Status: Closed * Priority: Normal * Assignee: Nobuyoshi Nakada * Category: core * Target version: current: 2.2.0 * ruby -v: 1.4.0 or later * Backport: 2.0.0: DONE, 2.1: DONE ---------------------------------------- `ruby_snprintf`���������`"%s"`������������������������������������������������������������������������������������������������������������������������`'\0'`������������������������ ~~~C /* t.c */ #include int main(void) { char buf[26]; ruby_snprintf(buf, sizeof(buf), "%.2s", "s"); printf("[%.2x][%.2x][%.2x]\n", buf[0], buf[1], buf[2]); return 0; } ~~~ ~~~ $ make t LDLIBS='$(LIBRUBYARG_STATIC) $(LIBS)' $ ./t [73][00][00] ~~~ ���������`missing/vsnprintf.c`������������������������������1.4.0��������������������������������������������������������������������� -- https://bugs.ruby-lang.org/