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());
|
last_error());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
expanded = (char *)malloc(strlen(path) + 1);
|
expanded = strdup(path);
|
||||||
|
|
||||||
if (expanded)
|
if (!expanded)
|
||||||
strcpy(expanded, path);
|
|
||||||
else
|
|
||||||
printc_err("%s: malloc: %s\n", __FUNCTION__,
|
printc_err("%s: malloc: %s\n", __FUNCTION__,
|
||||||
last_error());
|
last_error());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue