]> mj.ucw.cz Git - pciutils.git/commitdiff
Ignore NUL character at the end of VPD strings.
authorMartin Mares <mj@ucw.cz>
Sat, 22 Nov 2008 21:20:33 +0000 (22:20 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 22 Nov 2008 21:20:33 +0000 (22:20 +0100)
Broadcom Ethernet controllers have been observed to use NUL-terminated strings.

ls-vpd.c

index 413dcfd605b1be4d56cac83c40af26fea4836585..f50d7a4ef5a9f0500631e361d9a0ae012415539c 100644 (file)
--- a/ls-vpd.c
+++ b/ls-vpd.c
@@ -52,6 +52,8 @@ print_vpd_string(const byte *buf, word len)
       byte ch = *buf++;
       if (ch == '\\')
         printf("\\\\");
+      else if (!ch && !len)
+        ;  /* Cards with null-terminated strings have been observed */
       else if (ch < 32 || ch == 127)
         printf("\\x%02x", ch);
       else