Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
9fb3db9d
Commit
9fb3db9d
authored
Sep 21, 2016
by
Manuel Mohr
Browse files
Enlarge internal buffer.
Printing a large double (i.e., 1e256) exceeded the buffer size.
parent
6a01dd0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/libcore/lc_printf.c
View file @
9fb3db9d
...
...
@@ -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 12
8
letters for all other types should be enough. */
* buffer of
5
12 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
(
12
8
,
occ
->
width
+
1
);
int
len
=
MAX
(
5
12
,
occ
->
width
+
1
);
char
*
buf
=
XMALLOCN
(
char
,
len
);
res
=
dispatch_snprintf
(
buf
,
len
,
fmt
,
occ
->
lc_arg_type
,
val
);
assert
(
res
<
len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment