1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-06-02 07:20:47 +00:00

wayland: use arithmetic instead of wrong-endian memcpy

this fixes corruption of parsed colors in Wayland-only builds
This commit is contained in:
bi4k8 2023-01-03 20:01:48 +00:00 committed by Brenden Matthews
parent 31b4c27abc
commit d3e9bcbe71

View File

@ -121,8 +121,7 @@ long manually_get_x11_color(const char *name) {
argb[skip_alpha + i / 2] = val;
}
long out;
memcpy(static_cast<void *>(&out), argb, 4);
long out = (argb[0] << 24) | (argb[1] << 16) | (argb[2] << 8) | argb[3];
return out;
}
err: