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/12/29 16:06:00 UTC

[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8003: Add new api for signal and string

xiaoxiang781216 commented on code in PR #8003:
URL: https://github.com/apache/nuttx/pull/8003#discussion_r1059035056


##########
include/string.h:
##########
@@ -35,7 +35,9 @@
  ****************************************************************************/
 
 #define strcoll_l(s1, s2, l)    strcoll(s1, s2)
+#define strdupa(x)              strcpy(alloca(strlen(x) + 1), x)
 #define strerror_l(e, l)        strerror(e)
+#define strndupa(x, len)        strncpy(alloca(strlen(x) + 1), x, len)

Review Comment:
   The implementation looks wrong:
   https://github.com/esmil/musl/blob/master/include/string.h#L89-L95
   



-- 
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