This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new b58ecee1c apps/examples/udp: Fix warnings by -Wformat
b58ecee1c is described below
commit b58ecee1c9015f77689bf2f7fb6069bca88931cc
Author: SPRESENSE <[email protected]>
AuthorDate: Wed Feb 22 11:24:32 2023 +0900
apps/examples/udp: Fix warnings by -Wformat
Fix warnings where address of IPv4 is displayed.
---
examples/udp/udp_server.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/examples/udp/udp_server.c b/examples/udp/udp_server.c
index f06c0eb34..76934486b 100644
--- a/examples/udp/udp_server.c
+++ b/examples/udp/udp_server.c
@@ -168,10 +168,10 @@ void udp_server(void)
ntohs(client.sin6_port));
#else
tmpaddr = ntohl(client.sin_addr.s_addr);
- printf("server: %d. Received %d bytes from %d.%d.%d.%d:%d\n",
+ printf("server: %d. Received %d bytes from %u.%u.%u.%u:%d\n",
offset, nbytes,
- tmpaddr >> 24, (tmpaddr >> 16) & 0xff,
- (tmpaddr >> 8) & 0xff, tmpaddr & 0xff,
+ (uint8_t)(tmpaddr >> 24), (uint8_t)((tmpaddr >> 16) & 0xff),
+ (uint8_t)((tmpaddr >> 8) & 0xff), (uint8_t)(tmpaddr & 0xff),
ntohs(client.sin_port));
#endif
if (nbytes < 0)