From: Volker Lendecke Date: Wed, 12 May 2021 16:22:52 +0000 (+0200) Subject: printing: Simplify pack_devicemode() X-Git-Tag: tevent-0.11.0~663 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=93a28a5f2456bbcdd3104c251a019f1f4f354219;p=thirdparty%2Fsamba.git printing: Simplify pack_devicemode() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 982eb4f9cdd..415f86e6745 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -168,7 +168,7 @@ static TDB_DATA print_key(uint32_t jobid, uint32_t *tmp) static int pack_devicemode(struct spoolss_DeviceMode *devmode, uint8_t *buf, int buflen) { enum ndr_err_code ndr_err; - DATA_BLOB blob; + DATA_BLOB blob = { .data = NULL }; int len = 0; if (devmode) { @@ -181,8 +181,6 @@ static int pack_devicemode(struct spoolss_DeviceMode *devmode, uint8_t *buf, int "error encoding spoolss_DeviceMode\n")); goto done; } - } else { - ZERO_STRUCT(blob); } len = tdb_pack(buf, buflen, "B", blob.length, blob.data);