diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-06-03 08:33:52 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-06-03 08:33:52 +0200 |
commit | d80689f47847224ca3bef6c11183e0996ee29ab9 (patch) | |
tree | 0a3fea8ff3e24f596f62f9895796d4431cc4a7a2 | |
parent | doc (diff) | |
download | libgamma-d80689f47847224ca3bef6c11183e0996ee29ab9.tar.gz libgamma-d80689f47847224ca3bef6c11183e0996ee29ab9.tar.bz2 libgamma-d80689f47847224ca3bef6c11183e0996ee29ab9.tar.xz |
test uppercase behex and unhex + fix unhex
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r-- | src/lib/libgamma-facade.c.gpp | 2 | ||||
-rw-r--r-- | src/test/test.c | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/libgamma-facade.c.gpp b/src/lib/libgamma-facade.c.gpp index d380d97..033a7ef 100644 --- a/src/lib/libgamma-facade.c.gpp +++ b/src/lib/libgamma-facade.c.gpp @@ -637,7 +637,7 @@ unsigned char* libgamma_unhex_edid(const char* restrict edid) return errno = EINVAL, NULL; /* Allocate memory area for output octet array. */ - if ((out = malloc(n / 2 * sizeof(unsigned char))) == NULL) + if ((out = malloc(n /= 2 * sizeof(unsigned char))) == NULL) return NULL; /* Convert to raw octet array. */ diff --git a/src/test/test.c b/src/test/test.c index 6ff3311..e0481fc 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -369,10 +369,15 @@ static void crtc_information(libgamma_crtc_state_t* restrict crtc) libgamma_perror(" (error) EDID", info.edid_error); else { - char* edid = libgamma_behex_edid(info.edid, info.edid_length); - printf(" EDID: %s\n", edid); + char* edid_lc = libgamma_behex_edid(info.edid, info.edid_length); + unsigned char* edid_raw = libgamma_unhex_edid(edid_lc); + char* edid_uc = libgamma_behex_edid_uppercase(edid_raw, info.edid_length);; + printf(" EDID: %s\n", edid_lc); + printf(" EDID (uppercase): %s\n", edid_uc); printf(" EDID (length): %lu\n", info.edid_length); - free(edid); + free(edid_lc); + free(edid_raw); + free(edid_uc); } } print(size_t, LIBGAMMA_CRTC_INFO_WIDTH_MM, "width", width_mm); |