From 682cccd8af4008b508328672009a5bfc1344f55d Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 27 May 2000 02:05:15 +0000 Subject: unistr_to_dos not unistr_to_ascii (This used to be commit f46c4fe876a0cabe7044ca30c17e6c217d618635) --- source3/lib/util_unistr.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/lib') 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 @@ -106,6 +106,28 @@ void ascii_to_unistr(char *dest, const char *src, size_t maxlen) SSVAL(dest, 0, 0); } +/******************************************************************* + * 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. ********************************************************************/ -- cgit