MCPcopy Create free account
hub / github.com/F-Stack/f-stack / spt_copyargs

Function spt_copyargs

app/redis-6.2.6/src/setproctitle.c:164–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162
163
164static int spt_copyargs(int argc, char *argv[]) {
165 char *tmp;
166 int i;
167
168 for (i = 1; i < argc || (i >= argc && argv[i]); i++) {
169 if (!argv[i])
170 continue;
171
172 if (!(tmp = strdup(argv[i])))
173 return errno;
174
175 argv[i] = tmp;
176 }
177
178 return 0;
179} /* spt_copyargs() */
180
181/* Initialize and populate SPT to allow a future setproctitle()
182 * call.

Callers 1

spt_initFunction · 0.85

Calls 1

strdupFunction · 0.85

Tested by

no test coverage detected