]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - tools/perf/util/exec_cmd.c
perf_counter tools: Add more warnings and fix/annotate them
[mirror_ubuntu-artful-kernel.git] / tools / perf / util / exec_cmd.c
index d39292263153021ac44a6f9b4e2779ce63478094..34a3528673822622019687929f0499c4ebc0de1a 100644 (file)
@@ -1,6 +1,9 @@
 #include "cache.h"
 #include "exec_cmd.h"
 #include "quote.h"
+
+#include <string.h>
+
 #define MAX_ARGS       32
 
 extern char **environ;
@@ -51,7 +54,7 @@ const char *perf_extract_argv0_path(const char *argv0)
                slash--;
 
        if (slash >= argv0) {
-               argv0_path = strndup(argv0, slash - argv0);
+               argv0_path = xstrndup(argv0, slash - argv0);
                return slash + 1;
        }