From a9126e5c1caa169cab0133415f668de5d93655e3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 25 Jul 2001 04:00:40 +0000 Subject: ucs2 is always a multiple of 2 bytes this gets rid of a bunch of iconv warnings (This used to be commit 2ec59f731df6489756c5606ed63de90fb2a9241f) --- source3/lib/charcnv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index 49c4ba4063..9bbb8a8507 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -255,6 +255,9 @@ int push_ucs2(const void *base_ptr, void *dest, const char *src, int dest_len, i len++; } + /* ucs2 is always a multiple of 2 bytes */ + dest_len &= ~1; + len += convert_string(&unix_to_ucs2, src, src_len, dest, dest_len); return len; } @@ -285,6 +288,9 @@ int pull_ucs2(const void *base_ptr, char *dest, const void *src, int dest_len, i if (flags & STR_TERMINATE) src_len = strlen_w(src)*2+2; + /* ucs2 is always a multiple of 2 bytes */ + src_len &= ~1; + ret = convert_string(&ucs2_to_unix, src, src_len, dest, dest_len); if (dest_len) dest[MIN(ret, dest_len-1)] = 0; -- cgit