1
0
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:
Zdenek Kabelac 2019-11-14 17:13:02 +01:00
parent 153e55c20e
commit 0bad3977df

View File

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