1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-25 00:23:52 +03:00

r7936: new ldb_dn_explode and ldb_dn_casefold functions and co

This commit is contained in:
Simo Sorce
2005-06-26 23:59:22 +00:00
committed by Gerald (Jerry) Carter
parent 83d9d8f482
commit 7ccf21ab4e
7 changed files with 70 additions and 86 deletions

View File

@@ -917,6 +917,28 @@ char *talloc_strdup(const void *t, const char *p)
return ret;
}
/*
append to a talloced string
*/
char *talloc_append_string(const void *t, char *orig, const char *append)
{
char *ret;
size_t olen = strlen(orig);
size_t alenz = strlen(append) + 1;
if (!append)
return orig;
ret = talloc_realloc(t, orig, char, olen + alenz);
if (!ret)
return NULL;
/* append the string with the trailing \0 */
memcpy(&ret[olen], append, alenz);
return ret;
}
/*
strndup with a talloc
*/