From 153e55c20e9a3810a1862314a6465179e1b53931 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 14 Nov 2019 17:12:44 +0100 Subject: [PATCH] cov: check for retvalue --- tools/pvck.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.43.5