tools lib api fs: No need to use PATH_MAX + 1
authorJiri Olsa <jolsa@kernel.org>
Mon, 5 Oct 2015 18:06:01 +0000 (20:06 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 5 Oct 2015 19:12:09 +0000 (16:12 -0300)
Because there's no point, PATH_MAX is big enough.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1444068369-20978-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/api/fs/fs.c
tools/lib/api/fs/tracing_path.c

index 732dbef588b09d54da58939f76cc78234b20a4f0..459599d1b6c410b7b41333c13f248ee685c2dd4a 100644 (file)
@@ -69,7 +69,7 @@ static const char * const tracefs__known_mountpoints[] = {
 struct fs {
        const char              *name;
        const char * const      *mounts;
-       char                     path[PATH_MAX + 1];
+       char                     path[PATH_MAX];
        bool                     found;
        long                     magic;
 };
index 0406a7d5c891c4f1c6df4c0cf1c1f874164c32a5..a26bb5ea828307358803bc369bbb3c200d266b3d 100644 (file)
@@ -12,9 +12,9 @@
 #include "tracing_path.h"
 
 
-char tracing_mnt[PATH_MAX + 1]         = "/sys/kernel/debug";
-char tracing_path[PATH_MAX + 1]        = "/sys/kernel/debug/tracing";
-char tracing_events_path[PATH_MAX + 1] = "/sys/kernel/debug/tracing/events";
+char tracing_mnt[PATH_MAX]         = "/sys/kernel/debug";
+char tracing_path[PATH_MAX]        = "/sys/kernel/debug/tracing";
+char tracing_events_path[PATH_MAX] = "/sys/kernel/debug/tracing/events";
 
 
 static void __tracing_path_set(const char *tracing, const char *mountpoint)