libmultipath: parse_vpd_pg80: fix overflow output
authorMartin Wilck <mwilck@suse.com>
Mon, 24 Jun 2019 09:27:49 +0000 (11:27 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 3 Jul 2019 06:31:43 +0000 (08:31 +0200)
"vpd pg80 overflow, 20/20 bytes required" looks weird. Make it clear
that actually 21 bytes are required in this case.

Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/discovery.c

index efcea46..931a676 100644 (file)
@@ -912,7 +912,7 @@ parse_vpd_pg80(const unsigned char *in, char *out, size_t out_len)
 
        if (len >= out_len) {
                condlog(2, "vpd pg80 overflow, %d/%d bytes required",
 
        if (len >= out_len) {
                condlog(2, "vpd pg80 overflow, %d/%d bytes required",
-                       len, (int)out_len);
+                       len + 1, (int)out_len);
                len = out_len - 1;
        }
        if (len > 0) {
                len = out_len - 1;
        }
        if (len > 0) {