perf tools: Replace mempcpy with memcpy
authorIrina Tirdea <[email protected]>
Tue, 28 Aug 2012 22:22:16 +0000 (01:22 +0300)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 5 Sep 2012 22:35:21 +0000 (19:35 -0300)
mempcpy is not supported by bionic in Android and will lead to
compilation errors.

Replacing mempcpy with memcpy so it will work in Android.

Signed-off-by: Irina Tirdea <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt <[email protected]>
Link: http://lkml.kernel.org/r/CANg8OW+Y3ZMG-GdhYu2_yKOYH_XEMgw73PdCX_23UTnfYhmttA@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/target.c

index 051eaa68095e75a61b82aac4c479cf4c8101ef71..065528b7563e786dd149ac10be9a3f2b449a4732 100644 (file)
@@ -117,8 +117,8 @@ int perf_target__strerror(struct perf_target *target, int errnum,
 
                if (err != buf) {
                        size_t len = strlen(err);
-                       char *c = mempcpy(buf, err, min(buflen - 1, len));
-                       *c = '\0';
+                       memcpy(buf, err, min(buflen - 1, len));
+                       *(buf + min(buflen - 1, len)) = '\0';
                }
 
                return 0;