From 6944c5a0a142ffacf941c686160b108545c47d3c Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 17 Oct 2022 14:02:31 +0800 Subject: [PATCH] nshlib: Fix warning reported by clang nsh_telnetlogin.c:62:15: error: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion] Signed-off-by: Xiang Xiao --- nshlib/nsh_telnetlogin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nshlib/nsh_telnetlogin.c b/nshlib/nsh_telnetlogin.c index fc032cec6..3d9a68529 100644 --- a/nshlib/nsh_telnetlogin.c +++ b/nshlib/nsh_telnetlogin.c @@ -58,12 +58,12 @@ static void nsh_telnetecho(FAR struct console_stdio_s *pstate, uint8_t is_use) { - char optbuf[4]; + uint8_t optbuf[4]; optbuf[0] = TELNET_IAC; optbuf[1] = (is_use == TELNET_USE_ECHO) ? TELNET_WILL : TELNET_DO; optbuf[2] = 1; optbuf[3] = 0; - fputs(optbuf, pstate->cn_outstream); + fputs((FAR char *)optbuf, pstate->cn_outstream); fflush(pstate->cn_outstream); }