summaryrefslogtreecommitdiff
path: root/tools/perf/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/trace-event-read.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c
index b12e4903739a..a1217a10632f 100644
--- a/tools/perf/util/trace-event-read.c
+++ b/tools/perf/util/trace-event-read.c
@@ -113,8 +113,11 @@ static char *read_string(void)
}
}
+ /* trailing \0: */
+ i++;
+
/* move the file descriptor to the end of the string */
- r = lseek(input_fd, -(r - (i+1)), SEEK_CUR);
+ r = lseek(input_fd, -(r - i), SEEK_CUR);
if (r < 0)
die("lseek");