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

Function stringjoin

util1.c:912–936  ·  view source on GitHub ↗

Join any number of strings together, putting them in "dest". The return * value is the length of all the strings, regardless of whether the null- * terminated whole fits in destsize. Your list of string pointers must end * with a NULL to indicate the end of the list. */

Source from the content-addressed store, hash-verified

910 * terminated whole fits in destsize. Your list of string pointers must end
911 * with a NULL to indicate the end of the list. */
912size_t stringjoin(char *dest, size_t destsize, ...)
913{
914 va_list ap;
915 size_t len, ret = 0;
916 const char *src;
917
918 va_start(ap, destsize);
919 while (1) {
920 if (!(src = va_arg(ap, const char *)))
921 break;
922 len = strlen(src);
923 ret += len;
924 if (destsize > 1) {
925 if (len >= destsize)
926 len = destsize - 1;
927 memcpy(dest, src, len);
928 destsize -= len;
929 dest += len;
930 }
931 }
932 *dest = '\0';
933 va_end(ap);
934
935 return ret;
936}
937
938int count_dir_elements(const char *p)
939{

Callers 4

open_batch_filesFunction · 0.85
copy_valid_pathFunction · 0.85
get_backup_nameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected