changeset 38188:1baf1519ef5d

strerror: Make it compile in C++ mode. * lib/strerror.c (strerror): Ignore the return value of memcpy().
author Bruno Haible <bruno@clisp.org>
date Sat, 19 Nov 2016 12:50:28 +0100
parents f9db91b91fbc
children 3b86b4aeed71
files ChangeLog lib/strerror.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Nov 15 02:36:00 2016 +0000
+++ b/ChangeLog	Sat Nov 19 12:50:28 2016 +0100
@@ -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++
--- a/lib/strerror.c	Tue Nov 15 02:36:00 2016 +0000
+++ b/lib/strerror.c	Sat Nov 19 12:50:28 2016 +0100
@@ -66,5 +66,6 @@
   if (sizeof buf <= len)
     abort ();
 
-  return memcpy (buf, msg, len + 1);
+  memcpy (buf, msg, len + 1);
+  return buf;
 }