This removes the 3rd argument from init_unistr2(). There were 240
authorAndrew Tridgell <tridge@samba.org>
Fri, 17 Jan 2003 04:58:45 +0000 (04:58 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 17 Jan 2003 04:58:45 +0000 (04:58 +0000)
commitb9eff31b1433c81fbff733e194914a40f25e3bda
tree8d64e3824ebb8eb38700e59e0745f51632768916
parentf2c9c64900c4da24f73b188deb0f57271e3bf3e7
This removes the 3rd argument from init_unistr2(). There were 240
calls to init_unistr2() in the code and every one of them got the 3rd
argument incorrect, so I thought it best just to remove the argument.

The incorrect usage was caused by callers using strlen() to determine
the length of the string. The 3rd argument to init_unistr2() was
supposed to be the character length, not the byte length of the
string, so for non-english this could come out wrong.

I also removed the bogus 'always allocate at least 256 bytes'
hack. There may be some code that relies on this, but if there is then
the code is broken and needs fixing.
17 files changed:
source/python/py_spoolss_forms.c
source/python/py_spoolss_forms_conv.c
source/registry/reg_printing.c
source/rpc_client/cli_srvsvc.c
source/rpc_parse/parse_dfs.c
source/rpc_parse/parse_lsa.c
source/rpc_parse/parse_misc.c
source/rpc_parse/parse_net.c
source/rpc_parse/parse_reg.c
source/rpc_parse/parse_samr.c
source/rpc_parse/parse_spoolss.c
source/rpc_parse/parse_srv.c
source/rpc_server/srv_dfs_nt.c
source/rpc_server/srv_lsa_nt.c
source/rpc_server/srv_samr_nt.c
source/rpc_server/srv_spoolss_nt.c
source/rpcclient/cmd_spoolss.c