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
char *argsep(char **stringp, const char *delim);
char *strdup(const char *);
#endif

View File

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