From: Hans Verkuil <hansv...@cisco.com> Allow for spaces and '0x' prefixes.
Signed-off-by: Hans Verkuil <hansv...@cisco.com> --- edid-decode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edid-decode.c b/edid-decode.c index 58dc1c13..d38d2a3d 100644 --- a/edid-decode.c +++ b/edid-decode.c @@ -1976,7 +1976,7 @@ extract_edid(int fd) } /* Is the EDID provided in hex? */ - for (i = 0; i < 32 && isxdigit(ret[i]); i++); + for (i = 0; i < 32 && (isspace(ret[i]) || tolower(ret[i]) == 'x' || isxdigit(ret[i])); i++); if (i == 32) { out = malloc(size >> 1); if (out == NULL) { @@ -1987,7 +1987,7 @@ extract_edid(int fd) for (c=ret; *c; c++) { char buf[3]; - if (*c == '\n') + if (!isxdigit(*c) || (*c == '0' && tolower(c[1]) == 'x')) continue; /* Read a %02x from the log */ -- 2.14.1 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel