MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / strdup

Function strdup

components/libc/compilers/common/cstring.c:162–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162char *strdup(const char *s)
163{
164 char *news = (char *)malloc(strlen(s) + 1);
165
166 if (news)
167 {
168 strcpy(news, s);
169 }
170
171 return news;
172}
173
174char *strndup(const char *s, size_t size)
175{

Callers 12

_msh_exec_search_envFunction · 0.85
dtb_node_write_propFunction · 0.85
register_filenameFunction · 0.85
setupapfileFunction · 0.85
register_filenameFunction · 0.85
setupapfileFunction · 0.85
proc_cmdline_saveFunction · 0.85
snd_pcm_newFunction · 0.85
snd_pcm_file_openFunction · 0.85
cmd_arecord_madFunction · 0.85
snd_card_registerFunction · 0.85

Calls 1

mallocFunction · 0.50

Tested by

no test coverage detected