]> Savannah Git Hosting - gnulib.git/commitdiff
strerror: Make it compile in C++ mode.
authorBruno Haible <bruno@clisp.org>
Sat, 19 Nov 2016 11:50:28 +0000 (12:50 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 19 Nov 2016 13:05:25 +0000 (14:05 +0100)
* lib/strerror.c (strerror): Ignore the return value of memcpy().

ChangeLog
lib/strerror.c

index c0851b2bddf09fde9e4a69a030d2de44815368b5..c7bf5abc0d88a646a39a3d4928eacc15b3c31a6f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-11-19  Bruno Haible  <bruno@clisp.org>
+
+       strerror: Make it compile in C++ mode.
+       * lib/strerror.c (strerror): Ignore the return value of memcpy().
+
 2016-11-15  Pedro Alves  <palves@redhat.com>
 
        sys_time: add gnulib::timeval for C++
index 45c763391c1915a73266d7f9eafbb9788bad5b8f..8fff3bd6a8f4ac50dbdc4b9b7add8ff9d2fb7eea 100644 (file)
@@ -66,5 +66,6 @@ strerror (int n)
   if (sizeof buf <= len)
     abort ();
 
-  return memcpy (buf, msg, len + 1);
+  memcpy (buf, msg, len + 1);
+  return buf;
 }