From: Martin Mares Date: Sat, 22 Nov 2008 21:20:33 +0000 (+0100) Subject: Ignore NUL character at the end of VPD strings. X-Git-Tag: v3.1-alpha3~5 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=db2a16f414d1766d03c6f3bd8f2042f57e235273;p=pciutils.git Ignore NUL character at the end of VPD strings. Broadcom Ethernet controllers have been observed to use NUL-terminated strings. --- diff --git a/ls-vpd.c b/ls-vpd.c index 413dcfd..f50d7a4 100644 --- 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