summaryrefslogtreecommitdiffstats
path: root/src/blueshift_iccprofile.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-10 23:27:04 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-10 23:27:04 +0100
commitd567bb3e0f402eb3ff2d1b0d9615bef85efd405e (patch)
tree8f18928b0fd7ef59c5f2146aceae19a413348749 /src/blueshift_iccprofile.c
parentraise exception if blueshift_idcrtc fails (diff)
downloadblueshift-d567bb3e0f402eb3ff2d1b0d9615bef85efd405e.tar.gz
blueshift-d567bb3e0f402eb3ff2d1b0d9615bef85efd405e.tar.bz2
blueshift-d567bb3e0f402eb3ff2d1b0d9615bef85efd405e.tar.xz
_icc_profile atom support
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/blueshift_iccprofile.c')
-rw-r--r--src/blueshift_iccprofile.c15
1 files changed, 8 insertions, 7 deletions
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);