diff options
Diffstat (limited to 'trace-ftrace.c')
| -rw-r--r-- | trace-ftrace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/trace-ftrace.c b/trace-ftrace.c index af9ac8d..181a00f 100644 --- a/trace-ftrace.c +++ b/trace-ftrace.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <stdio.h> | 21 | #include <stdio.h> |
| 22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
| 23 | #include <string.h> | 23 | #include <string.h> |
| 24 | #include <sys/param.h> | ||
| 24 | 25 | ||
| 25 | #include "trace-cmd.h" | 26 | #include "trace-cmd.h" |
| 26 | 27 | ||
| @@ -148,7 +149,7 @@ static void print_graph_duration(struct trace_seq *s, unsigned long long duratio | |||
| 148 | 149 | ||
| 149 | /* Print nsecs (we don't want to exceed 7 numbers) */ | 150 | /* Print nsecs (we don't want to exceed 7 numbers) */ |
| 150 | if ((s->len - len) < 7) { | 151 | if ((s->len - len) < 7) { |
| 151 | snprintf(nsecs_str, 8 - (s->len - len), "%03lu", nsecs_rem); | 152 | snprintf(nsecs_str, MIN(sizeof(nsecs_str), 8 - len), "%03lu", nsecs_rem); |
| 152 | trace_seq_printf(s, ".%s", nsecs_str); | 153 | trace_seq_printf(s, ".%s", nsecs_str); |
| 153 | } | 154 | } |
| 154 | 155 | ||
