summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-09-30 15:22:02 +0200
committerGünther Deschner <gd@samba.org>2009-09-30 16:23:40 +0200
commitbbf394f36dbf2516ba92035791ebb67380de8d6e (patch)
tree2221e2cce189125cb0a7194c5c1a0cdb463db5d7
parent05e8e90976e86689425ccafc9ecfc1d99c53a3db (diff)
downloadsamba-bbf394f36dbf2516ba92035791ebb67380de8d6e.tar.gz
samba-bbf394f36dbf2516ba92035791ebb67380de8d6e.tar.bz2
samba-bbf394f36dbf2516ba92035791ebb67380de8d6e.zip
s3-printing: use regval_ctr_addvalue_multi_sz.
Guenther
-rw-r--r--source3/printing/nt_printing.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index f09615c06c..3c7f053ff2 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -3057,26 +3057,13 @@ static void map_bool_into_ctr(struct regval_ctr *ctr, const char *val_name,
static void map_single_multi_sz_into_ctr(struct regval_ctr *ctr, const char *val_name,
const char *multi_sz)
{
- smb_ucs2_t *conv_strs = NULL;
- size_t str_size;
-
- /* a multi-sz has to have a null string terminator, i.e., the last
- string must be followed by two nulls */
- str_size = strlen(multi_sz) + 2;
- conv_strs = SMB_CALLOC_ARRAY(smb_ucs2_t, str_size);
- if (!conv_strs) {
- return;
- }
+ const char *a[2];
- /* Change to byte units. */
- str_size *= sizeof(smb_ucs2_t);
- push_ucs2(NULL, conv_strs, multi_sz, str_size,
- STR_TERMINATE | STR_NOALIGN);
+ a[0] = multi_sz;
+ a[1] = NULL;
regval_ctr_delvalue(ctr, val_name);
- regval_ctr_addvalue(ctr, val_name, REG_MULTI_SZ,
- (char *) conv_strs, str_size);
- SAFE_FREE(conv_strs);
+ regval_ctr_addvalue_multi_sz(ctr, val_name, a);
}
/****************************************************************************