summaryrefslogtreecommitdiff
path: root/source4/lib/charset/util_unistr.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
commit5209a846a9157e649fcdcb561f7eaf19c8c0e465 (patch)
treeb0a7e52b5646c8eec182dbc391e7934b6804488c /source4/lib/charset/util_unistr.c
parent625359b2e266105022309df8985720108ecd6f67 (diff)
parent2ee8d29d22bcb1c350ab59d71b0aee548489bc9c (diff)
downloadsamba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.gz
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.bz2
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into regsrv
Conflicts: source4/lib/registry/ldb.c source4/rpc_server/winreg/rpc_winreg.c
Diffstat (limited to 'source4/lib/charset/util_unistr.c')
-rw-r--r--source4/lib/charset/util_unistr.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source4/lib/charset/util_unistr.c b/source4/lib/charset/util_unistr.c
index 09ec7b0471..e4f4bb551a 100644
--- a/source4/lib/charset/util_unistr.c
+++ b/source4/lib/charset/util_unistr.c
@@ -37,7 +37,7 @@ static void *lowcase_table;
/*******************************************************************
load the case handling tables
********************************************************************/
-static void load_case_tables(void)
+void load_case_tables(void)
{
TALLOC_CTX *mem_ctx;
@@ -386,6 +386,9 @@ _PUBLIC_ size_t strlen_m_term(const char *s)
**/
_PUBLIC_ char *strchr_m(const char *s, char c)
{
+ if (s == NULL) {
+ return NULL;
+ }
/* characters below 0x3F are guaranteed to not appear in
non-initial position in multi-byte charsets */
if ((c & 0xC0) == 0) {
@@ -411,6 +414,10 @@ _PUBLIC_ char *strrchr_m(const char *s, char c)
{
char *ret = NULL;
+ if (s == NULL) {
+ return NULL;
+ }
+
/* characters below 0x3F are guaranteed to not appear in
non-initial position in multi-byte charsets */
if ((c & 0xC0) == 0) {
@@ -570,7 +577,13 @@ _PUBLIC_ char *strupper_talloc(TALLOC_CTX *ctx, const char *src)
return strupper_talloc_n(ctx, src, src?strlen(src):0);
}
-
+/**
+ talloc_strdup() a unix string to upper case.
+**/
+_PUBLIC_ char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *src)
+{
+ return strupper_talloc(ctx, src);
+}
/**
Convert a string to lower case.