summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2019-11-14 17:12:44 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2019-11-14 18:06:42 +0100
commit153e55c20e9a3810a1862314a6465179e1b53931 (patch)
treebefc888a766182031690dcbff95263d028804389
parent44bf9c9a6af2d76d4de04b456362abd4ed454ff9 (diff)
downloadlvm2-153e55c20e9a3810a1862314a6465179e1b53931.tar.gz
cov: check for retvalue
-rw-r--r--tools/pvck.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/pvck.c b/tools/pvck.c
index 231faf998..79fb8fbc7 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -359,7 +359,10 @@ static int _dump_all_text(struct cmd_context *cmd, const char *tofile, struct de
continue;
}
- sscanf(line, "seqno = %u", &seqno);
+ if (sscanf(line, "seqno = %u", &seqno) != 1) {
+ log_warn("WARNING: Failed to parse seqno.");
+ seqno = 0; /* Skip? */
+ }
/*
* The first three lines look like metadata with