From: Volker Lendecke Date: Wed, 12 Jan 2022 11:09:51 +0000 (+0100) Subject: printing: Save a few lines with str_list_add_printf() X-Git-Tag: tdb-1.4.6~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6df560d353c18bb8a6f22cbed877642b29c2265b;p=thirdparty%2Fsamba.git printing: Save a few lines with str_list_add_printf() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/printing/print_svid.c b/source3/printing/print_svid.c index d20fdad88e3..4006323c051 100644 --- a/source3/printing/print_svid.c +++ b/source3/printing/print_svid.c @@ -49,21 +49,12 @@ bool sysv_cache_reload(struct pcap_cache **_pcache) DEBUG(5, ("reloading sysv printcap cache\n")); #endif - argl = talloc_zero_array(talloc_tos(), char *, 3); + argl = str_list_make_empty(talloc_tos()); + str_list_add_printf(&argl, "/usr/bin/lpstat"); + str_list_add_printf(&argl, "-v"); if (argl == NULL) { return false; } - argl[0] = talloc_strdup(argl, "/usr/bin/lpstat"); - if (argl[0] == NULL) { - TALLOC_FREE(argl); - return false; - } - argl[1] = talloc_strdup(argl, "-v"); - if (argl[1] == NULL) { - TALLOC_FREE(argl); - return false; - } - argl[2] = NULL; lines = file_lines_ploadv(talloc_tos(), argl, NULL); if (lines == NULL) {