1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

When removing an 'unused' function, it helps to remove the 'unused' callers...

Andrew Bartlett
(This used to be commit 605a89493e971f653413b06eda4bbca75029072b)
This commit is contained in:
Andrew Bartlett 2003-07-27 02:42:22 +00:00
parent 4b3e0268b5
commit 224a9f35b8

View File

@ -759,82 +759,6 @@ smb_ucs2_t *strstr_wa(const smb_ucs2_t *s, const char *ins)
return NULL;
}
/*******************************************************************
copy a string with max len
********************************************************************/
smb_ucs2_t *strncpy_wa(smb_ucs2_t *dest, const char *src, const size_t max)
{
smb_ucs2_t *ucs2_src;
if (!dest || !src) return NULL;
if (!(ucs2_src = acnv_uxu2(src)))
return NULL;
strncpy_w(dest, ucs2_src, max);
SAFE_FREE(ucs2_src);
return dest;
}
/*******************************************************************
convert and duplicate an ascii string
********************************************************************/
smb_ucs2_t *strdup_wa(const char *src)
{
return strndup_wa(src, 0);
}
/* if len == 0 then duplicate the whole string */
smb_ucs2_t *strndup_wa(const char *src, size_t len)
{
smb_ucs2_t *dest, *s;
s = acnv_dosu2(src);
if (!len) len = strlen_w(s);
dest = (smb_ucs2_t *)malloc((len + 1) * sizeof(smb_ucs2_t));
if (!dest) {
DEBUG(0,("strdup_w: out of memory!\n"));
SAFE_FREE(s);
return NULL;
}
memcpy(dest, src, len * sizeof(smb_ucs2_t));
dest[len] = 0;
SAFE_FREE(s);
return dest;
}
/*******************************************************************
append a string of len bytes and add a terminator
********************************************************************/
smb_ucs2_t *strncat_wa(smb_ucs2_t *dest, const char *src, const size_t max)
{
smb_ucs2_t *ucs2_src;
if (!dest || !src) return NULL;
if (!(ucs2_src = acnv_uxu2(src)))
return NULL;
strncat_w(dest, ucs2_src, max);
SAFE_FREE(ucs2_src);
return dest;
}
smb_ucs2_t *strcat_wa(smb_ucs2_t *dest, const char *src)
{
smb_ucs2_t *ucs2_src;
if (!dest || !src) return NULL;
if (!(ucs2_src = acnv_uxu2(src)))
return NULL;
strcat_w(dest, ucs2_src);
SAFE_FREE(ucs2_src);
return dest;
}
BOOL trim_string_wa(smb_ucs2_t *s, const char *front,
const char *back)
{