automatically generated from GPLed version
authorUlrich Drepper <drepper@redhat.com>
Thu, 6 Nov 1997 00:44:44 +0000 (00:44 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 6 Nov 1997 00:44:44 +0000 (00:44 +0000)
lib-src/getopt.c
src/strftime.c

index 570cb9d..2d3f3b6 100644 (file)
@@ -331,9 +331,9 @@ exchange (argv)
        nonoption_flags_len = nonoption_flags_max_len = 0;
       else
        {
-         memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len);
-         memset (&new_str[nonoption_flags_max_len], '\0',
-                 top + 1 - nonoption_flags_max_len);
+         memset (__mempcpy (new_str, __getopt_nonoption_flags,
+                            nonoption_flags_max_len),
+                 '\0', top + 1 - nonoption_flags_max_len);
          nonoption_flags_max_len = top + 1;
          __getopt_nonoption_flags = new_str;
        }
@@ -442,11 +442,8 @@ _getopt_initialize (argc, argv, optstring)
              if (__getopt_nonoption_flags == NULL)
                nonoption_flags_max_len = -1;
              else
-               {
-                 memcpy (__getopt_nonoption_flags, orig_str, len);
-                 memset (&__getopt_nonoption_flags[len], '\0',
-                         nonoption_flags_max_len - len);
-               }
+               memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
+                       '\0', nonoption_flags_max_len - len);
            }
        }
       nonoption_flags_len = nonoption_flags_max_len;
index 51dbc38..7439244 100644 (file)
@@ -91,6 +91,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
@@ -196,8 +204,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);                                                        \
@@ -210,8 +217,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);                                                        \