diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_unistr.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index c28ef44934..7379bd6811 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -107,6 +107,28 @@ void ascii_to_unistr(char *dest, const char *src, size_t maxlen) } /******************************************************************* + * HORRIBLE HACK! +********************************************************************/ +void unistr_to_ascii(char *dest, const uint16 *src, int len) +{ + char *destend = dest + len; + register uint16 c; + + while (dest < destend) + { + c = *(src++); + if (c == 0) + { + break; + } + + *(dest++) = (char)c; + } + + *dest = 0; +} + +/******************************************************************* Pull a DOS codepage string out of a UNICODE array. len is in bytes. ********************************************************************/ |