[PATCH] Relax edid-decode character checking

Jonathan McDowell noodles at earth.li
Thu Jan 17 11:58:16 PST 2013


extract_string in edid-decode currently only returns characters that
pass isalnum(). This causes an error when trying to parse the name of my
A/V receiver, which is "HT-R791". The VESA E-DID standard states that
normal ASCII is allowed for this field, not just alphanumeric
characters. Patch below changes to using isgraph() which will allow
anything printable.

Signed-off-by: Jonathan McDowell <noodles at earth.li>

-----
diff --git a/edid-decode.c b/edid-decode.c
index 9840db6..a714e49 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -145,7 +145,7 @@ extract_string(unsigned char *x, int *valid_termination, int len)
     memset(ret, 0, sizeof(ret));
 
     for (i = 0; i < len; i++) {
-	if (isalnum(x[i])) {
+	if (isgraph(x[i])) {
 	    ret[i] = x[i];
 	} else if (!seen_newline) {
 	    if (x[i] == 0x0a) {
-----

J.

-- 
101 things you can't have too much of : 36 - Spare video tapes.
This .sig brought to you by the letter E and the number 49
Product of the Republic of HuggieTag


More information about the xorg-devel mailing list