From 92794ed9a489da8cd7bf09d25cf613d7b24181e9 Mon Sep 17 00:00:00 2001 From: Daniel Kamil Kozar Date: Mon, 14 Dec 2015 00:10:16 +0100 Subject: [PATCH] Allow spaces as characters in EDID strings The E-EDID v1.4 specification does not forbid spaces from occuring in strings. However, isgraph() for a space returns false and causes the program to treat a string containing a space before the terminating newline as improperly terminated. Besides, the previous commit touching that line meant to 'allow anything printable', which is exactly what isprint() does. The EDID from a Dell U2715H connected via DisplayPort is attached. It can be used for reproducing the bug. --- data/dell-u2715h-dp | Bin 0 -> 256 bytes edid-decode.c | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 data/dell-u2715h-dp diff --git a/data/dell-u2715h-dp b/data/dell-u2715h-dp new file mode 100644 index 0000000000000000000000000000000000000000..125c4276c63bb615f576ace7a22e57b60d1df3ee GIT binary patch literal 256 zcmZSh4+abZYtkN{7BKOkhOH^XLziwuSSD;*je${QGg zAS{ky!GZ;v0R{@D450yv3=C2X3=IDn+&wHzT}&;!4NWY4xPT&m7+hR^d=x^B%neOF zxD5E5sH#Mp>YUjF>`%jw(cC9-}NnQQ!qRg*=T=sG1(G3tb8ibOi+Lra?p`JnR`x SH8dDFNCgN()c{=r0sjDr>^uPg literal 0 HcmV?d00001 diff --git a/edid-decode.c b/edid-decode.c index 0b94ad5..3cc3257 100644 --- a/edid-decode.c +++ b/edid-decode.c @@ -214,7 +214,7 @@ extract_string(unsigned char *x, int *valid_termination, int len) memset(ret, 0, sizeof(ret)); for (i = 0; i < len; i++) { - if (isgraph(x[i])) { + if (isprint(x[i])) { ret[i] = x[i]; } else if (!seen_newline) { if (x[i] == 0x0a) { -- 2.6.4