From d567bb3e0f402eb3ff2d1b0d9615bef85efd405e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 10 Mar 2014 23:27:04 +0100 Subject: _icc_profile atom support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blueshift_iccprofile.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/blueshift_iccprofile.c') diff --git a/src/blueshift_iccprofile.c b/src/blueshift_iccprofile.c index 152b547..688b335 100644 --- a/src/blueshift_iccprofile.c +++ b/src/blueshift_iccprofile.c @@ -184,16 +184,17 @@ int main(int argc, char** argv) } { - char* value = alloca((len + 1) * sizeof(char)); + char* value = alloca((2 * len + 1) * sizeof(char)); char* value_ = xcb_get_property_value(prop_reply); - memcpy(value, value_, len); - *(value + len) = 0; + for (i = 0; i < len; i++) + { + *(value + i * 2 + 0) = "0123456789abcdef"[(*(value_ + i) >> 4) & 15]; + *(value + i * 2 + 1) = "0123456789abcdef"[(*(value_ + i) >> 0) & 15]; + } + *(value + 2 * len) = 0; - printf("%i: %i: %s", screen_i, monitor, value); - fflush(stdout); - putchar('\0'); - putchar('\n'); + printf("%i: %i: %s\n", screen_i, monitor, value); } free(prop_reply); -- cgit v1.2.3-70-g09d2