1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-28 02:50:41 +03:00

cleanup: compare fgets pointer

Check pointer for not being NULL.
This commit is contained in:
Zdenek Kabelac 2015-08-18 15:48:05 +02:00
parent abb24370e9
commit a7abade088

View File

@ -2430,7 +2430,7 @@ static int _lvconvert_pool_repair(struct cmd_context *cmd,
* Scan only the 1st. line for transation id.
* Watch out, if the thin_dump format changes
*/
if ((fgets(meta_path, sizeof(meta_path), f) > 0) &&
if (fgets(meta_path, sizeof(meta_path), f) &&
(trans_id_str = strstr(meta_path, "transaction=\"")) &&
(sscanf(trans_id_str + 13, FMTu64, &trans_id) == 1) &&
(trans_id != first_seg(pool_lv)->transaction_id) &&