diff options
author | Gerald Carter <jerry@samba.org> | 2005-10-17 15:53:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:00 -0500 |
commit | c246649e3d7fb828b6d1c9531dfea40c92e2e368 (patch) | |
tree | e4682f4d5fc5e5abb83af9ab2c2d90f27777a722 /source3/registry/reg_util.c | |
parent | 1c5c61e3703ffca912f81496324ce82c2f19efa0 (diff) | |
download | samba-c246649e3d7fb828b6d1c9531dfea40c92e2e368.tar.gz samba-c246649e3d7fb828b6d1c9531dfea40c92e2e368.tar.bz2 samba-c246649e3d7fb828b6d1c9531dfea40c92e2e368.zip |
r11123: * patches from Brian Moran for creating new eventlog
source keys
* my patches to get registry utility functions linking
with eventlogadm tool
(This used to be commit 24e7663086f5d15c7e3fd8069667169b91d1acda)
Diffstat (limited to 'source3/registry/reg_util.c')
-rw-r--r-- | source3/registry/reg_util.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source3/registry/reg_util.c b/source3/registry/reg_util.c index 511e9b4335..9fd9dba27d 100644 --- a/source3/registry/reg_util.c +++ b/source3/registry/reg_util.c @@ -138,12 +138,12 @@ int regval_convert_multi_sz( uint16 *multi_string, size_t multi_len, char ***val *values = NULL; - if ( !multi_string || !*values ) + if ( !multi_string || !values ) return 0; /* just count the NULLs */ - for ( i=0; (i<multi_len-1) && !(multi_string[i]==0x0 && multi_string[i+1]==0x0); i++ ) { + for ( i=0; (i<multi_len-1) && !(multi_string[i]==0x0 && multi_string[i+1]==0x0); i+=2 ) { if ( multi_string[i] == 0x0 ) num_strings++; } @@ -187,7 +187,7 @@ size_t regval_build_multi_sz( char **values, uint16 **buffer ) uint16 *buf, *b; UNISTR2 sz; - if ( !values || !*buffer ) + if ( !values || !buffer ) return 0; /* go ahead and alloc some space */ @@ -199,7 +199,7 @@ 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 ); /* Alloc some more memory. Always add one one to account for the @@ -214,8 +214,8 @@ size_t regval_build_multi_sz( char **values, uint16 **buffer ) buf = b; /* copy the unistring2 buffer and increment the size */ - - memcpy( buf+buf_size, sz.buffer, sz.uni_str_len ); + /* 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; /* cleanup rather than leaving memory hanging around */ @@ -231,7 +231,3 @@ size_t regval_build_multi_sz( char **values, uint16 **buffer ) } - - - - |