summaryrefslogtreecommitdiff
path: root/source3/registry/reg_util.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-09-23 20:46:08 +0200
committerGünther Deschner <gd@samba.org>2009-09-30 00:29:49 +0200
commit2c11b73391551723e4ada8664b1ba77873420217 (patch)
tree9cd85bb729c6aa7e2801ebbcd9acbed39f7e8054 /source3/registry/reg_util.c
parentfcee9d2c97a673347baf58f749f35785a896e468 (diff)
downloadsamba-2c11b73391551723e4ada8664b1ba77873420217.tar.gz
samba-2c11b73391551723e4ada8664b1ba77873420217.tar.bz2
samba-2c11b73391551723e4ada8664b1ba77873420217.zip
s3-registry: use push_reg_sz().
Guenther
Diffstat (limited to 'source3/registry/reg_util.c')
-rw-r--r--source3/registry/reg_util.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/registry/reg_util.c b/source3/registry/reg_util.c
index 714a39f307..3b0885db82 100644
--- a/source3/registry/reg_util.c
+++ b/source3/registry/reg_util.c
@@ -221,7 +221,7 @@ size_t regval_build_multi_sz( char **values, uint16 **buffer )
int i;
size_t buf_size = 0;
uint16 *buf, *b;
- UNISTR2 sz;
+ DATA_BLOB sz;
if ( !values || !buffer )
return 0;
@@ -234,14 +234,14 @@ size_t regval_build_multi_sz( char **values, uint16 **buffer )
}
for ( i=0; values[i]; i++ ) {
- ZERO_STRUCT( sz );
+
/* DEBUG(0,("regval_build_multi_sz: building [%s]\n",values[i])); */
- init_unistr2( &sz, values[i], UNI_STR_TERMINATE );
+ push_reg_sz(talloc_tos(), &sz, values[i]);
/* Alloc some more memory. Always add one one to account for the
double NULL termination */
- b = TALLOC_REALLOC_ARRAY( NULL, buf, uint16, buf_size+sz.uni_str_len+1 );
+ b = TALLOC_REALLOC_ARRAY( NULL, buf, uint16, buf_size+sz.length/2+1 );
if ( !b ) {
DEBUG(0,("regval_build_multi_sz: talloc() reallocation error!\n"));
TALLOC_FREE( buffer );
@@ -250,12 +250,12 @@ size_t regval_build_multi_sz( char **values, uint16 **buffer )
buf = b;
/* copy the unistring2 buffer and increment the size */
- /* dump_data(1,sz.buffer,sz.uni_str_len*2); */
- memcpy( buf+buf_size, sz.buffer, sz.uni_str_len*2 );
- buf_size += sz.uni_str_len;
+ /* dump_data(1,sz.data,sz.length); */
+ memcpy( buf+buf_size, sz.data, sz.length);
+ buf_size += sz.length;
/* cleanup rather than leaving memory hanging around */
- TALLOC_FREE( sz.buffer );
+ TALLOC_FREE( sz.data );
}
buf[buf_size++] = 0x0;