found out that my atoi converter didn't work, so I switched back to strtol
This commit is contained in:
2023-11-30 10:38:07 +01:00
parent 9885971549
commit 84f5a61ddf

View File

@@ -109,9 +109,9 @@ static void tcp_cmd_parser(struct tcp_pcb* pcb, int argc, char** argv) {
return;
} if (argc == 4) {
color_bg = 0xff000000;
color_bg |= (uint32_t)(atoi(argv[1]) && 0xff) << 16;
color_bg |= (uint32_t)(atoi(argv[2]) && 0xff) << 8;
color_bg |= (uint32_t)(atoi(argv[3]) && 0xff);
color_bg |= (uint32_t)strtol(argv[1], NULL, 10) << 16;
color_bg |= (uint32_t)strtol(argv[2], NULL, 10) << 8;
color_bg |= (uint32_t)strtol(argv[3], NULL, 10);
return;
}
tcp_cmd_write(pcb, "Usage: bgcolor <background color>\n");
@@ -125,9 +125,9 @@ static void tcp_cmd_parser(struct tcp_pcb* pcb, int argc, char** argv) {
return;
} if (argc == 4) {
color_txt = 0xff000000;
color_txt |= (uint32_t)(atoi(argv[1]) && 0xff) << 16;
color_txt |= (uint32_t)(atoi(argv[2]) && 0xff) << 8;
color_txt |= (uint32_t)(atoi(argv[3]) && 0xff);
color_txt |= (uint32_t)strtol(argv[1], NULL, 10) << 16;
color_txt |= (uint32_t)strtol(argv[2], NULL, 10) << 8;
color_txt |= (uint32_t)strtol(argv[3], NULL, 10);
return;
}
tcp_cmd_write(pcb, "Usage: color 0x<txt color>\n");