aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Drepper1997-11-06 00:44:44 +0000
committerUlrich Drepper1997-11-06 00:44:44 +0000
commit4e941b8ea818755d90229d6e835e803436aafb97 (patch)
tree69afd1af80ed725c37f8e3de2a00fd9620032f78
parent4b7c78fcf17e578b61c0c8ea6eae30b45acf7f0e (diff)
downloademacs-4e941b8ea818755d90229d6e835e803436aafb97.tar.gz
emacs-4e941b8ea818755d90229d6e835e803436aafb97.zip
automatically generated from GPLed version
-rw-r--r--lib-src/getopt.c13
-rw-r--r--src/strftime.c14
2 files changed, 15 insertions, 12 deletions
diff --git a/lib-src/getopt.c b/lib-src/getopt.c
index 570cb9da69e..2d3f3b64bf2 100644
--- a/lib-src/getopt.c
+++ b/lib-src/getopt.c
@@ -331,9 +331,9 @@ exchange (argv)
331 nonoption_flags_len = nonoption_flags_max_len = 0; 331 nonoption_flags_len = nonoption_flags_max_len = 0;
332 else 332 else
333 { 333 {
334 memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); 334 memset (__mempcpy (new_str, __getopt_nonoption_flags,
335 memset (&new_str[nonoption_flags_max_len], '\0', 335 nonoption_flags_max_len),
336 top + 1 - nonoption_flags_max_len); 336 '\0', top + 1 - nonoption_flags_max_len);
337 nonoption_flags_max_len = top + 1; 337 nonoption_flags_max_len = top + 1;
338 __getopt_nonoption_flags = new_str; 338 __getopt_nonoption_flags = new_str;
339 } 339 }
@@ -442,11 +442,8 @@ _getopt_initialize (argc, argv, optstring)
442 if (__getopt_nonoption_flags == NULL) 442 if (__getopt_nonoption_flags == NULL)
443 nonoption_flags_max_len = -1; 443 nonoption_flags_max_len = -1;
444 else 444 else
445 { 445 memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
446 memcpy (__getopt_nonoption_flags, orig_str, len); 446 '\0', nonoption_flags_max_len - len);
447 memset (&__getopt_nonoption_flags[len], '\0',
448 nonoption_flags_max_len - len);
449 }
450 } 447 }
451 } 448 }
452 nonoption_flags_len = nonoption_flags_max_len; 449 nonoption_flags_len = nonoption_flags_max_len;
diff --git a/src/strftime.c b/src/strftime.c
index 51dbc389a75..7439244bc4d 100644
--- a/src/strftime.c
+++ b/src/strftime.c
@@ -91,6 +91,14 @@ extern char *tzname[];
91# endif 91# endif
92#endif 92#endif
93 93
94#ifdef _LIBC
95# define MEMPCPY(d, s, n) __mempcpy (d, s, n)
96#else
97# ifndef HAVE_MEMPCPY
98# define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n)))
99# endif
100#endif
101
94#ifndef __P 102#ifndef __P
95# if defined (__GNUC__) || (defined (__STDC__) && __STDC__) 103# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
96# define __P(args) args 104# define __P(args) args
@@ -196,8 +204,7 @@ static const char zeroes[16] = /* "0000000000000000" */
196 do \ 204 do \
197 { \ 205 { \
198 int _this = _len > 16 ? 16 : _len; \ 206 int _this = _len > 16 ? 16 : _len; \
199 memcpy ((P), spaces, _this); \ 207 (P) = mempcpy ((P), spaces, _this); \
200 (P) += _this; \
201 _len -= _this; \ 208 _len -= _this; \
202 } \ 209 } \
203 while (_len > 0); \ 210 while (_len > 0); \
@@ -210,8 +217,7 @@ static const char zeroes[16] = /* "0000000000000000" */
210 do \ 217 do \
211 { \ 218 { \
212 int _this = _len > 16 ? 16 : _len; \ 219 int _this = _len > 16 ? 16 : _len; \
213 memcpy ((P), zeroes, _this); \ 220 (P) = mempcpy ((P), zeroes, _this); \
214 (P) += _this; \
215 _len -= _this; \ 221 _len -= _this; \
216 } \ 222 } \
217 while (_len > 0); \ 223 while (_len > 0); \