mirror of
https://gitlab.com/c3d/db48x.git
synced 2024-09-29 05:36:58 +02:00
simulator: Avoid crash rendering %t in recorder
If we print a really large value, we need to cut off what we print. Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
parent
2fad76ce6c
commit
0df86b131f
1 changed files with 2 additions and 0 deletions
|
@ -59,6 +59,8 @@ size_t recorder_render_object(intptr_t tracing,
|
|||
{
|
||||
char tmp[80];
|
||||
size_t sz = value->render(tmp, sizeof(tmp)-1);
|
||||
if (sz >= sizeof(tmp))
|
||||
sz = sizeof(tmp)-1;
|
||||
tmp[sz] = 0;
|
||||
result = snprintf(buffer, size, "%p[%lu] %s[%s]",
|
||||
(void *) value,
|
||||
|
|
Loading…
Reference in a new issue