From 33a0497171b1329aa98af53722cdfadf3cdc9828 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 19 Nov 2016 12:50:28 +0100 Subject: [PATCH] strerror: Make it compile in C++ mode. * lib/strerror.c (strerror): Ignore the return value of memcpy(). --- ChangeLog | 5 +++++ lib/strerror.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c0851b2bdd..c7bf5abc0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-11-19 Bruno Haible + + strerror: Make it compile in C++ mode. + * lib/strerror.c (strerror): Ignore the return value of memcpy(). + 2016-11-15 Pedro Alves sys_time: add gnulib::timeval for C++ diff --git a/lib/strerror.c b/lib/strerror.c index 45c763391c..8fff3bd6a8 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -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; } -- 2.39.5