s3-lib Move strdup_w to it's only user in mangle_hash.c
authorAndrew Bartlett <abartlet@samba.org>
Tue, 12 Apr 2011 06:55:16 +0000 (16:55 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 13 Apr 2011 04:47:07 +0000 (14:47 +1000)
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
source3/include/proto.h
source3/lib/util_unistr.c
source3/smbd/mangle_hash.c

index a4de21faa2e75deaec26ee1385b70b499209e46f..48b94aacce4d0b45468f72a573d13f4552020d60 100644 (file)
@@ -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);
index 18df993b5a6481d4ffc4a53c7986a97daf7be7ac..26450e319b68365ec27c321ee93a861ff1aff611 100644 (file)
@@ -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
index 80cd3abc7b479919351908a20d404ea7c80cc10a..ebfacd1c335ab1b3debd8487453e2e031bdc49d7 100644 (file)
@@ -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
  */