aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--trace-split.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/trace-split.c b/trace-split.c
index 489e6cf..d3594ab 100644
--- a/trace-split.c
+++ b/trace-split.c
@@ -489,13 +489,12 @@ void trace_split (int argc, char **argv)
489 489
490 pevent = tracecmd_get_pevent(handle); 490 pevent = tracecmd_get_pevent(handle);
491 491
492 if (!output) { 492 if (!output)
493 if (repeat) 493 output = strdup(input_file);
494 output = strdup(input_file); 494
495 else { 495 if (!repeat) {
496 output = malloc_or_die(strlen(input_file) + 3); 496 output = realloc(output, strlen(output) + 3);
497 sprintf(output, "%s.1", input_file); 497 strcat(output, ".1");
498 }
499 } 498 }
500 499
501 current = start_ns; 500 current = start_ns;