diff options
author | Matthew Chapman <matty@samba.org> | 1999-02-12 00:16:09 +0000 |
---|---|---|
committer | Matthew Chapman <matty@samba.org> | 1999-02-12 00:16:09 +0000 |
commit | fd96929ec1fa27e0affd4c4e9ba307c4ee30b978 (patch) | |
tree | 6bfb5226bc58be39aaf7cfb954dcb472ea256a11 /source3/rpc_client/cli_reg.c | |
parent | f38bfc7d9aa07c4e21448aa846956bd89a259a65 (diff) | |
download | samba-fd96929ec1fa27e0affd4c4e9ba307c4ee30b978.tar.gz samba-fd96929ec1fa27e0affd4c4e9ba307c4ee30b978.tar.bz2 samba-fd96929ec1fa27e0affd4c4e9ba307c4ee30b978.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).
(This used to be commit a1d39af1ce1d451b811dbd7c2ba391214851b87e)
Diffstat (limited to 'source3/rpc_client/cli_reg.c')
-rw-r--r-- | source3/rpc_client/cli_reg.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c index b3d2f6e864..6fe48599d5 100644 --- a/source3/rpc_client/cli_reg.c +++ b/source3/rpc_client/cli_reg.c @@ -306,7 +306,7 @@ BOOL do_reg_query_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd, valid_query = True; *class_len = r_o.hdr_class.uni_max_len; - fstrcpy(class, unistr2_to_str(&r_o.uni_class)); + unistr2_to_ascii(class, &r_o.uni_class, sizeof(class)); *num_subkeys = r_o.num_subkeys ; *max_subkeylen = r_o.max_subkeylen ; *max_subkeysize = r_o.max_subkeysize; @@ -425,7 +425,8 @@ BOOL do_reg_query_info(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd, if (p) { valid_query = True; - fstrcpy(type, buffer2_to_str(&r_o.uni_type)); + unistr_to_ascii(type, r_o.uni_type.buffer, + MIN(r_o.uni_type.buf_len, sizeof(type))); (*unk_0) = r_o.unknown_0; (*unk_1) = r_o.unknown_1; } @@ -786,7 +787,8 @@ BOOL do_reg_enum_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd, valid_query = True; (*unk_1) = r_o.unknown_1; (*unk_2) = r_o.unknown_2; - fstrcpy(key_name, unistr2(r_o.key_name.str.buffer)); + unistr_to_ascii(key_name, r_o.key_name.str.buffer, + sizeof(key_name)); (*mod_time) = nt_time_to_unix(&r_o.time); } } @@ -902,7 +904,7 @@ BOOL do_reg_enum_val(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd, { valid_query = True; (*val_type) = r_o.type; - fstrcpy(val_name, unistr2_to_str(&r_o.uni_name)); + unistr2_to_ascii(val_name, &r_o.uni_name, sizeof(val_name)); } } |