summaryrefslogtreecommitdiff
path: root/source3/lib/util_unistr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util_unistr.c')
-rw-r--r--source3/lib/util_unistr.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index 1dff5964fd..e1a2e26623 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -238,3 +238,26 @@ void buffer2_to_multistr(char *dest, const BUFFER2 *str, size_t maxlen)
*dest = 0;
}
+
+/*******************************************************************
+ Convert a buffer4 to space-separated ASCII.
+ ********************************************************************/
+void buffer4_to_str(char *dest, const BUFFER4 *str, size_t maxlen)
+{
+ char *destend;
+ const uchar *src;
+ size_t len;
+ register uint16 c;
+
+ src = str->buffer;
+ len = MIN(str->buf_len, maxlen);
+ destend = dest + len;
+
+ while (dest < destend)
+ {
+ c = *(src++);
+ *(dest++) = (char)c;
+ }
+
+ *dest = 0;
+}