summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-02-17 14:12:40 -0800
committerJeremy Allison <jra@samba.org>2012-02-18 06:22:40 +0100
commit21528da9cd12a4f5c3792a482a5d18fe946a6f7a (patch)
tree4b8c37725dd728e00f25a8b4e2e9b52d7ff7fd5a /source3/lib
parente786e8fef9960aadf1e94c70c0fb7ec18c1ed237 (diff)
downloadsamba-21528da9cd12a4f5c3792a482a5d18fe946a6f7a.tar.gz
samba-21528da9cd12a4f5c3792a482a5d18fe946a6f7a.tar.bz2
samba-21528da9cd12a4f5c3792a482a5d18fe946a6f7a.zip
Fix a bunch of "unused variable" warnings.
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Feb 18 06:22:40 CET 2012 on sn-devel-104
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/charcnv.c74
1 files changed, 0 insertions, 74 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index ecf62e551a..5863d72f38 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -297,80 +297,6 @@ static size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_
return len;
}
-
-
-/**
- Copy a string from a ucs2 source to a unix char* destination.
- Flags can have:
- STR_TERMINATE means the string in src is null terminated.
- STR_NOALIGN means don't try to align.
- if STR_TERMINATE is set then src_len is ignored if it is -1.
- src_len is the length of the source area in bytes
- Return the number of bytes occupied by the string in src.
- The resulting string in "dest" is always null terminated.
-**/
-
-static size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_len, size_t src_len, int flags)
-{
- size_t size = 0;
- size_t ucs2_align_len = 0;
- bool ret;
-
- if (dest_len == (size_t)-1) {
- /* No longer allow dest_len of -1. */
- smb_panic("pull_ucs2 - invalid dest_len of -1");
- }
-
- if (!src_len) {
- if (dest && dest_len > 0) {
- dest[0] = '\0';
- }
- return 0;
- }
-
- if (ucs2_align(base_ptr, src, flags)) {
- src = (const void *)((const char *)src + 1);
- if (src_len != (size_t)-1)
- src_len--;
- ucs2_align_len = 1;
- }
-
- if (flags & STR_TERMINATE) {
- /* src_len -1 is the default for null terminated strings. */
- if (src_len != (size_t)-1) {
- size_t len = strnlen_w((const smb_ucs2_t *)src,
- src_len/2);
- if (len < src_len/2)
- len++;
- src_len = len*2;
- }
- }
-
- /* ucs2 is always a multiple of 2 bytes */
- if (src_len != (size_t)-1)
- src_len &= ~1;
-
- ret = convert_string(CH_UTF16LE, CH_UNIX, src, src_len, dest, dest_len, &size);
- if (ret == false) {
- size = 0;
- dest_len = 0;
- }
-
- if (src_len == (size_t)-1)
- src_len = size*2;
-
- if (dest_len && size) {
- /* Did we already process the terminating zero ? */
- if (dest[MIN(size-1, dest_len-1)] != 0) {
- dest[MIN(size, dest_len-1)] = 0;
- }
- } else {
- dest[0] = 0;
- }
-
- return src_len + ucs2_align_len;
-}
-
/**
Copy a string from a ucs2 source to a unix char* destination.
Talloc version with a base pointer.