MCPcopy Index your code
hub / github.com/RsyncProject/rsync / poptSaveString

Function poptSaveString

popt/popt.c:897–915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895}
896
897int poptSaveString(const char *** argvp,
898 UNUSED(unsigned int argInfo), const char * val)
899{
900 int argc = 0;
901
902 if (argvp == NULL || val == NULL)
903 return POPT_ERROR_NULLARG;
904
905 /* XXX likely needs an upper bound on argc. */
906 if (*argvp != NULL)
907 while ((*argvp)[argc] != NULL)
908 argc++;
909
910 if ((*argvp = xrealloc(*argvp, (argc + 1 + 1) * sizeof(**argvp))) != NULL) {
911 (*argvp)[argc++] = xstrdup(val);
912 (*argvp)[argc ] = NULL;
913 }
914 return 0;
915}
916
917static long long poptRandomValue(long long limit)
918{

Callers 1

poptSaveArgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected