tools lib traceevent: replace mempcpy with memcpy
authorIrina Tirdea <irina.tirdea@intel.com>
Sat, 8 Sep 2012 00:43:22 +0000 (03:43 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 8 Sep 2012 01:11:20 +0000 (22:11 -0300)
The mempcpy function 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 <irina.tirdea@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1347065004-15306-11-git-send-email-irina.tirdea@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/traceevent/event-parse.c

index 4595aeb3c4321504a09324d81c97e3418468061f..f4190b5764de6a7fb949e35bc2ff97da386329f3 100644 (file)
@@ -4833,8 +4833,8 @@ int pevent_strerror(struct pevent *pevent, enum pevent_errno errnum,
                msg = strerror_r(errnum, buf, buflen);
                if (msg != buf) {
                        size_t len = strlen(msg);
-                       char *c = mempcpy(buf, msg, min(buflen-1, len));
-                       *c = '\0';
+                       memcpy(buf, msg, min(buflen - 1, len));
+                       *(buf + min(buflen - 1, len)) = '\0';
                }
                return 0;
        }