1
0
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:
Zdenek Kabelac 2010-10-25 12:08:15 +00:00
parent fc218865bf
commit 0775e8060e

View File

@ -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;