We don't need to implement strdup

After defining _GNU_SOURCE
This commit is contained in:
Drew DeVault 2015-11-12 19:42:44 -05:00
parent 11b1ba397f
commit c43ef2aedd
3 changed files with 6 additions and 16 deletions

View file

@ -33,5 +33,4 @@ char *cmdsep(char **stringp, const char *delim);
// Split string into 2 by delim, handle quotes // Split string into 2 by delim, handle quotes
char *argsep(char **stringp, const char *delim); char *argsep(char **stringp, const char *delim);
char *strdup(const char *);
#endif #endif

View file

@ -362,12 +362,3 @@ char *argsep(char **stringp, const char *delim) {
found: found:
return start; return start;
} }
char *strdup(const char *str) {
char *dup = malloc(strlen(str) + 1);
if (dup) {
strcpy(dup, str);
}
return dup;
}