summaryrefslogtreecommitdiff
path: root/source4/lib/charset/util_unistr.c
diff options
context:
space:
mode:
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.