diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 08b6759287f5e7cb9429a611a880b6fbe2991302..59a9c0b3033e12352ad0754a0f3cfcb5aaeac3c5 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -209,7 +209,7 @@ static int __dsos__write_buildid_table(struct list_head *head, int fd) err = do_write(fd, pos->long_name, pos->long_name_len + 1); if (err < 0) return err; - err = do_write(fd, zero_buf, len - pos->long_name_len + 1); + err = do_write(fd, zero_buf, len - pos->long_name_len - 1); if (err < 0) return err; }