diff options
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_util.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/source3/registry/reg_util.c b/source3/registry/reg_util.c index e468a6244a..fd7652116f 100644 --- a/source3/registry/reg_util.c +++ b/source3/registry/reg_util.c @@ -158,56 +158,3 @@ char *reg_remaining_path(TALLOC_CTX *ctx, const char *key) return p; } - -/********************************************************************** -*********************************************************************/ - -int regval_convert_multi_sz( uint16 *multi_string, size_t byte_len, char ***values ) -{ - char **sz; - int i; - int num_strings = 0; - fstring buffer; - uint16 *wp; - size_t multi_len = byte_len / 2; - - if ( !multi_string || !values ) - return 0; - - *values = NULL; - - /* just count the NULLs */ - - for ( i=0; (i<multi_len-1) && !(multi_string[i]==0x0 && multi_string[i+1]==0x0); i++ ) { - /* peek ahead */ - if ( multi_string[i+1] == 0x0 ) - num_strings++; - } - - if ( num_strings == 0 ) - return 0; - - if ( !(sz = TALLOC_ARRAY( NULL, char*, num_strings+1 )) ) { - DEBUG(0,("reg_convert_multi_sz: talloc() failed!\n")); - return -1; - } - - wp = multi_string; - - for ( i=0; i<num_strings; i++ ) { - rpcstr_pull( buffer, wp, sizeof(buffer), -1, STR_TERMINATE ); - sz[i] = talloc_strdup( sz, buffer ); - - /* skip to the next string NULL and then one more */ - while ( *wp ) - wp++; - wp++; - } - - /* tag the array off with an empty string */ - sz[i] = '\0'; - - *values = sz; - - return num_strings; -} |