com32: remove strpcpy() - we already have stpcpy()
authorH. Peter Anvin <hpa@zytor.com>
Thu, 13 Aug 2009 04:23:10 +0000 (21:23 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 13 Aug 2009 04:23:10 +0000 (21:23 -0700)
Remove strpcpy(); it is exactly the same thing as stpcpy() which we
already have, and which is more "standard" (in the sense that none of
these are actually standard...)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/include/string.h
com32/lib/Makefile
com32/lib/strpcpy.c [deleted file]
com32/mboot/mboot.c

index c964ee3..af9792b 100644 (file)
@@ -23,7 +23,6 @@ __extern char *strcat(char *, const char *);
 __extern char *strchr(const char *, int);
 __extern int strcmp(const char *, const char *);
 __extern char *strcpy(char *, const char *);
-__extern char *strpcpy(char *, const char *);
 __extern size_t strcspn(const char *, const char *);
 __extern char *strdup(const char *);
 __extern char *strndup(const char *, size_t);
index 1806ec2..0f43aee 100644 (file)
@@ -17,7 +17,7 @@ LIBOBJS = \
        exit.o onexit.o \
        perror.o printf.o puts.o qsort.o realloc.o seed48.o snprintf.o  \
        sprintf.o srand48.o sscanf.o stack.o strcasecmp.o strcat.o      \
-       strchr.o strcmp.o strcpy.o strpcpy.o strdup.o strlen.o          \
+       strchr.o strcmp.o strcpy.o strdup.o strlen.o                    \
        strerror.o strnlen.o                                            \
        strncasecmp.o strncat.o strncmp.o strncpy.o strndup.o           \
        stpcpy.o stpncpy.o                                              \
diff --git a/com32/lib/strpcpy.c b/com32/lib/strpcpy.c
deleted file mode 100644 (file)
index a4fd2a0..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * strpcpy.c
- *
- * strpcpy() - strcpy() which returns a pointer to the final null
- */
-
-#include <string.h>
-
-char *strpcpy(char *dst, const char *src)
-{
-    char *q = dst;
-    const char *p = src;
-    char ch;
-
-    do {
-       *q++ = ch = *p++;
-    } while (ch);
-
-    return q - 1;
-}
index e7bb8db..62ebf52 100644 (file)
@@ -135,7 +135,7 @@ static int get_modules(char **argv, struct module_data **mdp)
            char *p;
            mp->cmdline = p = malloc(arglen);
            for (; *argp && strcmp(*argp, module_separator); argp++) {
-               p = strpcpy(p, *argp);
+               p = stpcpy(p, *argp);
                *p++ = ' ';
            }
            *--p = '\0';