remove calling sprintf(); ref #1210

This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-04-25 15:00:09 +09:00
parent f0bea86437
commit 8464cac63c
+5 -1
View File
@@ -2348,8 +2348,12 @@ mrb_str_dump(mrb_state *mrb, mrb_value str)
*q++ = c;
}
else {
int oct = c & 0xff;
*q++ = '\\';
sprintf(q, "%03o", c&0xff);
q[2] = '0' + oct % 8; oct /= 8;
q[1] = '0' + oct % 8; oct /= 8;
q[0] = '0' + oct % 8;
q += 3;
}
}