From 84f5a61ddf352ab5cb37ebea5eeabe6eb174965f Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Thu, 30 Nov 2023 10:38:07 +0100 Subject: [PATCH] tcp_cmd found out that my atoi converter didn't work, so I switched back to strtol --- tests/tcp_cmd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/tcp_cmd.cpp b/tests/tcp_cmd.cpp index 5bc79d8..a6ce4f4 100644 --- a/tests/tcp_cmd.cpp +++ b/tests/tcp_cmd.cpp @@ -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 \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\n");