Permalink
Browse files

formatting buffer should be bigger for negative dots; ref #3025

  • Loading branch information...
matz committed Nov 18, 2015
1 parent f974880 commit abc724840e268d8f1dbe413cc3e06f0c368596d6
Showing with 2 additions and 2 deletions.
  1. +2 −2 mrbgems/mruby-sprintf/src/sprintf.c
@@ -71,7 +71,7 @@ sign_bits(int base, const char *p)
static mrb_value
mrb_fix2binstr(mrb_state *mrb, mrb_value x, int base)
{
char buf[64], *b = buf + sizeof buf;
char buf[66], *b = buf + sizeof buf;
mrb_int num = mrb_fixnum(x);
uint64_t val = (uint64_t)num;
char d;
@@ -759,7 +759,7 @@ mrb_str_format(mrb_state *mrb, int argc, const mrb_value *argv, mrb_value fmt)
case 'B':
case 'u': {
mrb_value val = GETARG();
char fbuf[32], nbuf[64], *s;
char fbuf[32], nbuf[68], *s;
const char *prefix = NULL;
int sign = 0, dots = 0;
char sc = 0;

0 comments on commit abc7248

Please sign in to comment.