diff options
Diffstat (limited to 'tools/perf/tests/sdt.c')
-rw-r--r-- | tools/perf/tests/sdt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/tests/sdt.c b/tools/perf/tests/sdt.c index f59d210e1baf..06eda675ae2c 100644 --- a/tools/perf/tests/sdt.c +++ b/tools/perf/tests/sdt.c @@ -1,6 +1,6 @@ +#include <errno.h> #include <stdio.h> #include <sys/epoll.h> -#include <util/util.h> #include <util/evlist.h> #include <linux/filter.h> #include "tests.h" @@ -43,7 +43,7 @@ static char *get_self_path(void) { char *buf = calloc(PATH_MAX, sizeof(char)); - if (buf && readlink("/proc/self/exe", buf, PATH_MAX) < 0) { + if (buf && readlink("/proc/self/exe", buf, PATH_MAX - 1) < 0) { pr_debug("Failed to get correct path of perf\n"); free(buf); return NULL; |