summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-04-12 16:55:16 +1000
committerAndrew Tridgell <tridge@samba.org>2011-04-13 14:47:07 +1000
commitce2f217bd2402ada76c13bf3c170c8f55752fb11 (patch)
tree3efd73d49a5e9c2e5499030af2fbb681c59c7320
parente3138f2ffef32ee33778e0c068c6009a58536419 (diff)
downloadsamba-ce2f217bd2402ada76c13bf3c170c8f55752fb11.tar.gz
samba-ce2f217bd2402ada76c13bf3c170c8f55752fb11.tar.bz2
samba-ce2f217bd2402ada76c13bf3c170c8f55752fb11.zip
s3-lib Move strdup_w to it's only user in mangle_hash.c
Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/util_unistr.c18
-rw-r--r--source3/smbd/mangle_hash.c19
3 files changed, 19 insertions, 19 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index a4de21faa2..48b94aacce 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1063,7 +1063,6 @@ bool strupper_w(smb_ucs2_t *s);
int strcmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b);
int strcasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b);
int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len);
-smb_ucs2_t *strdup_w(const smb_ucs2_t *src);
int strcmp_wa(const smb_ucs2_t *a, const char *b);
int toupper_ascii(int c);
int tolower_ascii(int c);
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index 18df993b5a..26450e319b 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -306,24 +306,6 @@ int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len)
return (len - n)?(tolower_m(*(COPY_UCS2_CHAR(&cpa,a))) - tolower_m(*(COPY_UCS2_CHAR(&cpb,b)))):0;
}
-/*******************************************************************
- Duplicate string.
-********************************************************************/
-
-smb_ucs2_t *strdup_w(const smb_ucs2_t *src)
-{
- smb_ucs2_t *dest;
- size_t len = strlen_w(src);
- dest = SMB_MALLOC_ARRAY(smb_ucs2_t, len + 1);
- if (!dest) {
- DEBUG(0,("strdup_w: out of memory!\n"));
- return NULL;
- }
-
- memcpy(dest, src, len * sizeof(smb_ucs2_t));
- dest[len] = 0;
- return dest;
-}
/*
The *_wa() functions take a combination of 7 bit ascii
and wide characters They are used so that you can use string
diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c
index 80cd3abc7b..ebfacd1c33 100644
--- a/source3/smbd/mangle_hash.c
+++ b/source3/smbd/mangle_hash.c
@@ -143,6 +143,25 @@ static NTSTATUS has_illegal_chars(const smb_ucs2_t *s, bool allow_wildcards)
return NT_STATUS_OK;
}
+/*******************************************************************
+ Duplicate string.
+********************************************************************/
+
+static smb_ucs2_t *strdup_w(const smb_ucs2_t *src)
+{
+ smb_ucs2_t *dest;
+ size_t len = strlen_w(src);
+ dest = SMB_MALLOC_ARRAY(smb_ucs2_t, len + 1);
+ if (!dest) {
+ DEBUG(0,("strdup_w: out of memory!\n"));
+ return NULL;
+ }
+
+ memcpy(dest, src, len * sizeof(smb_ucs2_t));
+ dest[len] = 0;
+ return dest;
+}
+
/* return False if something fail and
* return 2 alloced unicode strings that contain prefix and extension
*/