mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvm: fix reporting path with HOME envvar
When envvar HOME is not present we were using invalid path with (null).
This commit is contained in:
parent
7e017abb30
commit
493af2bb16
@ -154,7 +154,7 @@ static int _hist_file(char *buffer, size_t size)
|
|||||||
{
|
{
|
||||||
char *e = getenv("HOME");
|
char *e = getenv("HOME");
|
||||||
|
|
||||||
if (dm_snprintf(buffer, size, "%s/.lvm_history", e) < 0) {
|
if (dm_snprintf(buffer, size, "%s%s.lvm_history", e ? :"", e ? "/" : "") < 0) {
|
||||||
log_error("$HOME/.lvm_history: path too long");
|
log_error("$HOME/.lvm_history: path too long");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user