MCPcopy Create free account
hub / github.com/RsyncProject/rsync / set_envN_str

Function set_envN_str

clientserver.c:465–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463#if defined HAVE_SETENV || defined HAVE_PUTENV
464
465static void set_envN_str(const char *var, int num, const char *str)
466{
467#ifdef HAVE_SETENV
468 char buf[128];
469 (void)snprintf(buf, sizeof buf, "%s%d", var, num);
470 if (setenv(buf, str, 1) < 0)
471 out_of_memory("set_env_str");
472#else
473#ifdef HAVE_PUTENV
474 char *mem;
475 if (asprintf(&mem, "%s%d=%s", var, num, str) < 0)
476 out_of_memory("set_envN_str");
477 putenv(mem);
478#endif
479#endif
480}
481
482void set_env_num(const char *var, long num)
483{

Callers 1

start_pre_execFunction · 0.85

Calls 1

asprintfFunction · 0.85

Tested by

no test coverage detected