expand_tilde: use strdup() instead of malloc()/strcpy().
The OpenBSD linker complains about the reference to strcpy(). Pointed out by Jasper Lievisse Adriaanse <jasper@openbsd.org>.
This commit is contained in:
parent
1d1323cabc
commit
2528e2a752
|
@ -348,11 +348,9 @@ char *expand_tilde(const char *path)
|
|||
last_error());
|
||||
}
|
||||
} else {
|
||||
expanded = (char *)malloc(strlen(path) + 1);
|
||||
expanded = strdup(path);
|
||||
|
||||
if (expanded)
|
||||
strcpy(expanded, path);
|
||||
else
|
||||
if (!expanded)
|
||||
printc_err("%s: malloc: %s\n", __FUNCTION__,
|
||||
last_error());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue