1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

util_str: add talloc_asprintf_strlower_m().

Guenther
(This used to be commit 7f8b0b4d15)
This commit is contained in:
Günther Deschner 2008-06-04 01:29:22 +02:00
parent 12281d02ae
commit d4c5a1d504
2 changed files with 18 additions and 0 deletions

View File

@ -1730,6 +1730,7 @@ void sprintf_append(TALLOC_CTX *mem_ctx, char **string, ssize_t *len,
size_t *bufsize, const char *fmt, ...); size_t *bufsize, const char *fmt, ...);
int asprintf_strupper_m(char **strp, const char *fmt, ...); int asprintf_strupper_m(char **strp, const char *fmt, ...);
char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...); char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...);
char *talloc_asprintf_strlower_m(TALLOC_CTX *t, const char *fmt, ...);
char *sstring_sub(const char *src, char front, char back); char *sstring_sub(const char *src, char front, char back);
bool validate_net_name( const char *name, bool validate_net_name( const char *name,
const char *invalid_chars, const char *invalid_chars,

View File

@ -2615,6 +2615,23 @@ char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...)
return ret; return ret;
} }
char *talloc_asprintf_strlower_m(TALLOC_CTX *t, const char *fmt, ...)
{
va_list ap;
char *ret;
va_start(ap, fmt);
ret = talloc_vasprintf(t, fmt, ap);
va_end(ap);
if (ret == NULL) {
return NULL;
}
strlower_m(ret);
return ret;
}
/* /*
Returns the substring from src between the first occurrence of Returns the substring from src between the first occurrence of
the char "front" and the first occurence of the char "back". the char "front" and the first occurence of the char "back".