From 1668825d337c3a9549eb558d14551a207c3a8c20 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 2 Nov 2023 11:49:34 +0100 Subject: [PATCH] edid-decode: show Serial Number also in hex In decimal only it is hard to detect that 16843009 is actually a typical dummy serial number value. Showing this in hex (0x01010101) suddenly makes it clear that this S/N is not reliable. Signed-off-by: Hans Verkuil --- parse-base-block.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parse-base-block.cpp b/parse-base-block.cpp index c39e672..9395bb0 100644 --- a/parse-base-block.cpp +++ b/parse-base-block.cpp @@ -1386,12 +1386,13 @@ void edid_state::parse_base_block(const unsigned char *x) manufacturer_name(x + 0x08), (unsigned short)(x[0x0a] + (x[0x0b] << 8))); if (base.has_serial_number) { + unsigned sn = x[0x0c] + (x[0x0d] << 8) + + (x[0x0e] << 16) + (x[0x0f] << 24); + if (hide_serial_numbers) printf(" Serial Number: ...\n"); else - printf(" Serial Number: %u\n", - (unsigned)(x[0x0c] + (x[0x0d] << 8) + - (x[0x0e] << 16) + (x[0x0f] << 24))); + printf(" Serial Number: %u (0x%08x)\n", sn, sn); } time(&the_time); -- 2.11.4.GIT