aboutsummaryrefslogtreecommitdiffstats
path: root/parse-displayid-block.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-11-21 12:08:57 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-11-21 12:08:57 +0100
commitff4b82e4004db6789576f722bba4057d256b647f (patch)
tree9e274091ffe5e0f4d609b7f03d5a1e2a22882092 /parse-displayid-block.cpp
parent0f2a75d1132d8634f370b5668379a0e257c1566e (diff)
edid-decode: improve the DisplayID Extension Block check
The failure message issues when the total number of DisplayID Extension Blocks does not match what the first DisplayID block contains was a bit confusing. Improve the message. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'parse-displayid-block.cpp')
-rw-r--r--parse-displayid-block.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/parse-displayid-block.cpp b/parse-displayid-block.cpp
index df55e38..ad873a3 100644
--- a/parse-displayid-block.cpp
+++ b/parse-displayid-block.cpp
@@ -1451,9 +1451,9 @@ void edid_state::parse_displayid_block(const unsigned char *x)
fail("DisplayID Base Block has no product type.\n");
if (ext_count != dispid.preparse_displayid_blocks - 1)
fail("Expected %u DisplayID Extension Block%s, but got %u\n",
- dispid.preparse_displayid_blocks - 1,
- dispid.preparse_displayid_blocks == 2 ? "" : "s",
- ext_count);
+ ext_count,
+ ext_count > 1 ? "s" : "",
+ dispid.preparse_displayid_blocks - 1);
} else {
if (prod_type)
fail("Product Type should be 0 in extension block.\n");

Privacy Policy