From: Paul Menzel Subject: [edid-decode] [PATCH] extract_string: Replace `isalnum()` with `isprint()` to allow underscores Date: Mon, 29 Oct 2012 10:41:05 +0100 Message-ID: <1351503665.5799.6.camel@mattotaupa> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0381185093==" Return-path: Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B0909E95A for ; Mon, 29 Oct 2012 02:41:26 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0381185093== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-IAlVPYreaUQIpcYwzbwb" --=-IAlVPYreaUQIpcYwzbwb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=3D26294#c27 [2] https://bugs.freedesktop.org/show_bug.cgi?id=3D26294#c3 Signed-off-by: Paul Menzel -- 1. I do not know if the X server or the Intel DDX driver(?) writes the valu= e 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)); =20 for (i =3D 0; i < len; i++) { - if (isalnum(x[i])) { + if (isprint(x[i])) { ret[i] =3D x[i]; } else if (!seen_newline) { if (x[i] =3D=3D 0x0a) { --=20 1.7.10.4 --=-IAlVPYreaUQIpcYwzbwb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAlCOTzEACgkQPX1aK2wOHVi0eQCfYvERf1A5uUwGHtBEgJqrfhZK obUAoIbhiXmIQ+AasK+AcKC/lZvW2L2P =0TmC -----END PGP SIGNATURE----- --=-IAlVPYreaUQIpcYwzbwb-- --===============0381185093== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0381185093==--