summaryrefslogtreecommitdiffhomepage
path: root/ir/libcore
diff options
context:
space:
mode:
authorManuel Mohr <manuel.mohr@kit.edu>2016-09-21 16:36:05 +0200
committerManuel Mohr <manuel.mohr@kit.edu>2016-10-20 11:13:29 +0200
commit9fb3db9d72a99212b92d7e30f5a885551770d0d0 (patch)
treed5bc3bef9e8785276aef71aa0d356fed1e28636c /ir/libcore
parent6a01dd0a907fd6fb5be2fd4737fd3fee163731a0 (diff)
Enlarge internal buffer.
Printing a large double (i.e., 1e256) exceeded the buffer size.
Diffstat (limited to 'ir/libcore')
-rw-r--r--ir/libcore/lc_printf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ir/libcore/lc_printf.c b/ir/libcore/lc_printf.c
index ebcae46..e511b98 100644
--- a/ir/libcore/lc_printf.c
+++ b/ir/libcore/lc_printf.c
@@ -249,7 +249,7 @@ static int std_emit(lc_appendable_t *app, const lc_arg_occ_t *occ, const lc_arg_
}
/* strings are dumped directly, since they can get really big. A
- * buffer of 128 letters for all other types should be enough. */
+ * buffer of 512 letters for all other types should be enough. */
case 's': {
const char *str = (const char*)val->v_ptr;
size_t size = strlen(str);
@@ -259,7 +259,7 @@ static int std_emit(lc_appendable_t *app, const lc_arg_occ_t *occ, const lc_arg_
}
default: {
- int len = MAX(128, occ->width + 1);
+ int len = MAX(512, occ->width + 1);
char *buf = XMALLOCN(char, len);
res = dispatch_snprintf(buf, len, fmt, occ->lc_arg_type, val);
assert(res < len);