summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index 9290ed726c..cb266a9841 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -67,7 +67,8 @@ sign_bits(int base, const char *p)
#define CHECK(l) do {\
int cr = ENC_CODERANGE(result);\
- while ((l) >= bsiz - blen) {\
+ RUBY_ASSERT(bsiz >= blen); \
+ while ((l) > bsiz - blen) {\
bsiz*=2;\
if (bsiz<0) rb_raise(rb_eArgError, "too big specifier");\
}\