mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Reuse result of previous strchr
Reported by clang as: Argument with 'nonnull' attribute passed null Reuse the result of the last strchr() call - make sure, 'st' point is not null for the next strchr() call.
This commit is contained in:
parent
fc218865bf
commit
0775e8060e
@ -869,7 +869,7 @@ const char *extract_vgname(struct cmd_context *cmd, const char *lv_name)
|
||||
while (*st == '/')
|
||||
st++;
|
||||
|
||||
if (!strchr(vg_name, '/') || strchr(st, '/')) {
|
||||
if (!st || strchr(st, '/')) {
|
||||
log_error("\"%s\": Invalid path for Logical Volume",
|
||||
lv_name);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user