s3-registry: use push_reg_sz().
[kai/samba.git] / source3 / registry / reg_backend_db.c
index dec43ae741a9f7160d83d07f82da5b84356abab3..b9ff5dc7fc63b8374ebad7591117de34880edd8e 100644 (file)
@@ -250,7 +250,7 @@ WERROR init_registry_key(const char *add_path)
 static void regdb_ctr_add_value(struct regval_ctr *ctr,
                                struct builtin_regkey_value *value)
 {
-       UNISTR2 data;
+       DATA_BLOB data;
 
        switch(value->type) {
        case REG_DWORD:
@@ -260,10 +260,10 @@ static void regdb_ctr_add_value(struct regval_ctr *ctr,
                break;
 
        case REG_SZ:
-               init_unistr2(&data, value->data.string, UNI_STR_TERMINATE);
+               push_reg_sz(talloc_tos(), &data, value->data.string);
                regval_ctr_addvalue(ctr, value->valuename, REG_SZ,
-                                   (char*)data.buffer,
-                                   data.uni_str_len*sizeof(uint16));
+                                   (char*)data.data,
+                                   data.length);
                break;
 
        default: