summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-04-25 04:33:08 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-04-25 04:33:08 +0900
commit48f36d3f0ef9e1672a7eca95f289156095fc9f26 (patch)
treee26091b4a35d41bc2cd7780dcbb96a7cfa916a55 /src/string.c
parent83c1399af0d750e7a629dbf0ed6b7d0f59cf79ec (diff)
downloadmruby-48f36d3f0ef9e1672a7eca95f289156095fc9f26.tar.gz
mruby-48f36d3f0ef9e1672a7eca95f289156095fc9f26.zip
better integer size assertion suggested by usak
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index b2a625eea..9c66ae18f 100644
--- a/src/string.c
+++ b/src/string.c
@@ -272,7 +272,7 @@ str_buf_cat(mrb_state *mrb, struct RString *s, const char *ptr, size_t len)
ptr = STR_PTR(s) + off;
}
memcpy(STR_PTR(s) + STR_LEN(s), ptr, len);
- mrb_assert(total <= MRB_INT_MAX);
+ mrb_assert_int_fit(size_t, total, mrb_int, MRB_INT_MAX);
STR_SET_LEN(s, total);
STR_PTR(s)[total] = '\0'; /* sentinel */
}