diff options
author | Luke Leighton <lkcl@samba.org> | 2000-05-27 02:05:15 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 2000-05-27 02:05:15 +0000 |
commit | 682cccd8af4008b508328672009a5bfc1344f55d (patch) | |
tree | b9891716e3597906d11b72b2481d75e0db6f758c /source3/lib | |
parent | 54695647ef52558e5f83744898b7c5c95c9fed5a (diff) | |
download | samba-682cccd8af4008b508328672009a5bfc1344f55d.tar.gz samba-682cccd8af4008b508328672009a5bfc1344f55d.tar.bz2 samba-682cccd8af4008b508328672009a5bfc1344f55d.zip |
unistr_to_dos not unistr_to_ascii
(This used to be commit f46c4fe876a0cabe7044ca30c17e6c217d618635)
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. ********************************************************************/ |