Skip to content
Snippets Groups Projects
Commit 047c3257 authored by Andre Maroneze's avatar Andre Maroneze
Browse files

avoid crash when printing backtrace

parent 9c02adc0
No related branches found
No related tags found
No related merge requests found
......@@ -55,9 +55,16 @@ static void trace() {
char *prefix = (counter) ? " - " : "";
if (ipr) {
char *outs = (char*)ipr->stdouts;
outs[strlen(outs)-1] = '\0';
if (strlen(outs) && endswith(outs, "??:0") && endswith(outs, "??:?")) {
printf("%s%s\n", prefix, outs);
if (outs) {
outs[strlen(outs)-1] = '\0';
if (strlen(outs) && endswith(outs, "??:0") && endswith(outs, "??:?")) {
printf("%s%s\n", prefix, outs);
}
} else {
char *errs = (char*)ipr->stderrs;
if (errs) {
printf("%s\n", errs);
}
}
}
bb++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment