[edid-decode] [PATCH] extract_string: Replace `isalnum()` with `isprint()` to allow underscores
Paul Menzel
paulepanter at users.sourceforge.net
Mon Oct 29 02:41:05 PDT 2012
Date: Mon, 29 Oct 2012 10:17:54 +0100
The EDID of the Philips 32PFL5404H contains the monitor name
`PHILIPS_FTV`. `isalnum()` returns false for the underscore, causing
`edid-decode` to not print the whole name and to complain that the
string is not properly terminated [1].
Monitor name: PHILIPS
Checksum: 0x1 (valid)
EDID block does NOT conform to EDID 1.3!
Detailed block string not properly terminated
The X server writes the correct name to `/var/log/Xorg.0.log` [2].
(II) intel(0): Monitor name: PHILIPS_FTV
Changing the check to `isprint()` also allows underscores and therefore
fixes the incorrect output and brings it in line with the X server.
Monitor name: PHILIPS_FTV
Checksum: 0x1 (valid)
[1] https://bugs.freedesktop.org/show_bug.cgi?id=26294#c27
[2] https://bugs.freedesktop.org/show_bug.cgi?id=26294#c3
Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
--
1. I do not know if the X server or the Intel DDX driver(?) writes the value to `Xorg.0.log`.
2. Also I did not check the EDID specification if underscores are actually allowed.
3. `isascii()` cannot be used as it returns true also for '\n'.
---
edid-decode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/edid-decode.c b/edid-decode.c
index 9840db6..191649c 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 (isprint(x[i])) {
ret[i] = x[i];
} else if (!seen_newline) {
if (x[i] == 0x0a) {
--
1.7.10.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20121029/8dc79bb5/attachment.pgp>
More information about the dri-devel
mailing list