mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
cov: avoid passing NULL to strstr function
When 'str1' would be NULL, there is no point to run 2nd. strstr().
This commit is contained in:
parent
153e55c20e
commit
0bad3977df
10
tools/pvck.c
10
tools/pvck.c
@ -420,11 +420,11 @@ static int _dump_all_text(struct cmd_context *cmd, const char *tofile, struct de
|
||||
memset(line, 0, sizeof(line));
|
||||
_copy_line(str1, line, &len);
|
||||
log_print("%s", line);
|
||||
}
|
||||
if ((str2 = strstr(str1, "creation_time = "))) {
|
||||
memset(line, 0, sizeof(line));
|
||||
_copy_line(str2, line, &len);
|
||||
log_print("%s\n", line);
|
||||
if ((str2 = strstr(str1, "creation_time = "))) {
|
||||
memset(line, 0, sizeof(line));
|
||||
_copy_line(str2, line, &len);
|
||||
log_print("%s\n", line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user