summaryrefslogtreecommitdiffstats
path: root/source/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
authorMatthew Chapman <matty@samba.org>1999-02-12 00:16:09 +0000
committerMatthew Chapman <matty@samba.org>1999-02-12 00:16:09 +0000
commita1d39af1ce1d451b811dbd7c2ba391214851b87e (patch)
tree50763e0eb25cd4b9bcd4c988d633ef808a46f8cd /source/rpc_parse/parse_misc.c
parent6a437cfb33f24913e0c1f8484c0b08ef317e513b (diff)
downloadsamba-a1d39af1ce1d451b811dbd7c2ba391214851b87e.tar.gz
samba-a1d39af1ce1d451b811dbd7c2ba391214851b87e.tar.xz
samba-a1d39af1ce1d451b811dbd7c2ba391214851b87e.zip
UNICODE cleanup (see lib/util_unistr.c).
No more ugly static library buffers and all functions take a destination string length (especially unistrcpy was rather dangerous; we were only saved by the fact that datagrams are limited in size).
Diffstat (limited to 'source/rpc_parse/parse_misc.c')
-rw-r--r--source/rpc_parse/parse_misc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/rpc_parse/parse_misc.c b/source/rpc_parse/parse_misc.c
index 7c3f4469087..04a9ba4544d 100644
--- a/source/rpc_parse/parse_misc.c
+++ b/source/rpc_parse/parse_misc.c
@@ -328,8 +328,7 @@ creates a UNISTR structure.
********************************************************************/
void make_unistr(UNISTR *str, char *buf)
{
- /* store the string (null-terminated copy) */
- str_to_unistr16(str->buffer, buf);
+ ascii_to_unistr(str->buffer, buf, sizeof(str->buffer));
}
/*******************************************************************
@@ -371,8 +370,8 @@ void make_buffer3_str(BUFFER3 *str, char *buf, int len)
str->buf_max_len = len * 2;
str->buf_len = len * 2;
- /* store the string (null-terminated 8 bit chars into 16 bit chars) */
- str_to_unistr8(str->buffer, buf);
+ /* store the string (little endian buffer) */
+ ascii_to_unibuf(str->buffer, buf, str->buf_len);
}
/*******************************************************************
@@ -572,8 +571,8 @@ void make_unistr2(UNISTR2 *str, const char *buf, int len)
str->undoc = 0;
str->uni_str_len = len;
- /* store the string (null-terminated 8 bit chars into 16 bit chars) */
- str_to_unistr16((str->buffer), buf);
+ /* store the string (wide chars) */
+ ascii_to_unistr(str->buffer, buf, len);
}
/*******************************************************************