fix bug of tcp_cmd_bg_color writing to color_txt when in argb mode
This commit is contained in:
2023-12-08 12:30:15 +01:00
committed by Sander Speetjens
parent a37213b128
commit 86f0a3bedc

View File

@@ -146,11 +146,11 @@ static void tcp_cmd_bg_color(struct tcp_pcb* pcb, int argc, char** argv) {
}
if (argc == 4) {
LOG_INFO(TAG, "Setting background color to %s %s %s %s", argv[0], argv[1], argv[2], argv[3]);
color_txt = 0xff000000;
color_txt ^= (uint32_t)strtoul(argv[0], NULL, 10) << 24;
color_txt |= (uint32_t)strtoul(argv[1], NULL, 10) << 16;
color_txt |= (uint32_t)strtoul(argv[2], NULL, 10) << 8;
color_txt |= (uint32_t)strtoul(argv[3], NULL, 10);
color_bg = 0xff000000;
color_bg ^= (uint32_t)strtoul(argv[0], NULL, 10) << 24;
color_bg |= (uint32_t)strtoul(argv[1], NULL, 10) << 16;
color_bg |= (uint32_t)strtoul(argv[2], NULL, 10) << 8;
color_bg |= (uint32_t)strtoul(argv[3], NULL, 10);
return;
}
LOG_WARN(TAG, "Bad usage of bgcolor");