s3: use pull_reg_multi_sz in rpcclient and net.
authorGünther Deschner <gd@samba.org>
Tue, 29 Sep 2009 21:22:46 +0000 (23:22 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 29 Sep 2009 22:31:42 +0000 (00:31 +0200)
Guenther

source3/rpcclient/cmd_spoolss.c
source3/utils/net_rpc_printer.c

index 48f9df3cacf71ef98cf80c9586a33fce67cc6d2c..6a525514a467047a93227210803b0424e6ae4050 100644 (file)
@@ -723,18 +723,17 @@ static void display_reg_value(struct regval_blob value)
                break;
        }
        case REG_MULTI_SZ: {
-               uint32_t i, num_values;
-               char **values;
+               uint32_t i;
+               const char **values;
+               DATA_BLOB blob = data_blob_const(value.data_p, value.size);
 
-               if (!W_ERROR_IS_OK(reg_pull_multi_sz(NULL, value.data_p,
-                                                    value.size, &num_values,
-                                                    &values))) {
-                       d_printf("reg_pull_multi_sz failed\n");
+               if (!pull_reg_multi_sz(NULL, &blob, &values)) {
+                       d_printf("pull_reg_multi_sz failed\n");
                        break;
                }
 
                printf("%s: REG_MULTI_SZ: \n", value.valuename);
-               for (i=0; i<num_values; i++) {
+               for (i=0; values[i] != NULL; i++) {
                        d_printf("%s\n", values[i]);
                }
                TALLOC_FREE(values);
index c3924efc6a6794056bce689845d7816fe0781e98..9a8e0a9ba6df3bb89b33c09990416c86894c7ae4 100644 (file)
@@ -100,17 +100,17 @@ static void display_reg_value(const char *subkey, struct regval_blob value)
                break;
 
        case REG_MULTI_SZ: {
-               uint32_t i, num_values;
-               char **values;
+               uint32_t i;
+               const char **values;
+               DATA_BLOB blob = data_blob_const(value.data_p, value.size);
 
-               if (!W_ERROR_IS_OK(reg_pull_multi_sz(NULL, value.data_p,
-                                                    value.size, &num_values,
-                                                    &values))) {
-                       d_printf(_("reg_pull_multi_sz failed\n"));
+               if (!pull_reg_multi_sz(NULL, &blob, &values)) {
+                       d_printf("pull_reg_multi_sz failed\n");
                        break;
                }
 
-               for (i=0; i<num_values; i++) {
+               printf("%s: REG_MULTI_SZ: \n", value.valuename);
+               for (i=0; values[i] != NULL; i++) {
                        d_printf("%s\n", values[i]);
                }
                TALLOC_FREE(values);