You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/18 15:10:51 UTC

[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5786: netdb/getaddrinfo: fix the compile warning

anchao commented on a change in pull request #5786:
URL: https://github.com/apache/incubator-nuttx/pull/5786#discussion_r830073239



##########
File path: libs/libc/netdb/lib_getaddrinfo.c
##########
@@ -77,7 +77,7 @@ FAR static struct ai_s *alloc_ai(int family, int socktype, int protocol,
       case AF_LOCAL:
         ai->ai.ai_addrlen       = sizeof(struct sockaddr_un);
         ai->sa.sun.sun_family   = AF_LOCAL;
-        strncpy(ai->sa.sun.sun_path, addr, sizeof(ai->sa.sun.sun_path));
+        strncpy(ai->sa.sun.sun_path, addr, sizeof(ai->sa.sun.sun_path) - 1);

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org