about summary refs log tree commit diff
path: root/time/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/strftime.c')
-rw-r--r--time/strftime.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/time/strftime.c b/time/strftime.c
index fdf0500a92..8d94dcdf60 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -89,6 +89,14 @@ extern char *tzname[];
 # endif
 #endif
 
+#ifdef _LIBC
+# define MEMPCPY(d, s, n) __mempcpy (d, s, n)
+#else
+# ifndef HAVE_MEMPCPY
+#  define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n)))
+# endif
+#endif
+
 #ifndef __P
 # if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
 #  define __P(args) args
@@ -194,8 +202,7 @@ static const char zeroes[16] = /* "0000000000000000" */
     do									      \
       {									      \
 	int _this = _len > 16 ? 16 : _len;				      \
-	memcpy ((P), spaces, _this);					      \
-	(P) += _this;							      \
+	(P) = mempcpy ((P), spaces, _this);				      \
 	_len -= _this;							      \
       }									      \
     while (_len > 0);							      \
@@ -208,8 +215,7 @@ static const char zeroes[16] = /* "0000000000000000" */
     do									      \
       {									      \
 	int _this = _len > 16 ? 16 : _len;				      \
-	memcpy ((P), zeroes, _this);					      \
-	(P) += _this;							      \
+	(P) = mempcpy ((P), zeroes, _this);				      \
 	_len -= _this;							      \
       }									      \
     while (_len > 0);							      \