diff options
author | Adam Jackson <ajax@redhat.com> | 2017-03-28 11:21:36 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-03-28 11:21:36 -0400 |
commit | 57c73067385e0bd29d0a67fd73db4ebecc8fb084 (patch) | |
tree | bfcebc968032876557e4521b27759bd19ecb3526 | |
parent | c72db881557ba5d3546e9a4a0c85184ed3b4dbc1 (diff) |
Fix valid termination check
This was mishandling spaces before the terminating newline, the result
would be truncated and we'd falsely consider the block to be incorrectly
terminated.
Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r-- | edid-decode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/edid-decode.c b/edid-decode.c index c18697f..cc124bc 100644 --- a/edid-decode.c +++ b/edid-decode.c @@ -219,6 +219,8 @@ extract_string(unsigned char *x, int *valid_termination, int len) } else if (!seen_newline) { if (x[i] == 0x0a) { seen_newline = 1; + } else if (x[i] == 0x20) { + ret[i] = x[i]; } else { *valid_termination = 0; return ret; |