From 3527b5cc25d4177e860745b16409984610ed11df Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 8 Mar 2006 01:18:18 +0000 Subject: r14003: Clarify code that lead to Coverity report #13. Not a bug, but better to remove false positives. Jeremy. (This used to be commit f9a75d76546bc4618736f0d48646e77d7572db25) --- source3/printing/lpq_parse.c | 2 +- source3/printing/print_generic.c | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/source3/printing/lpq_parse.c b/source3/printing/lpq_parse.c index 68c06ade41..7e81b5187c 100644 --- a/source3/printing/lpq_parse.c +++ b/source3/printing/lpq_parse.c @@ -971,7 +971,7 @@ BOOL parse_lpq_entry(enum printing_types printing_type,char *line, } /* in the LPRNG case, we skip lines starting by a space.*/ - if (line && !ret && (printing_type==PRINT_LPRNG) ) + if (!ret && (printing_type==PRINT_LPRNG) ) { if (line[0]==' ') return ret; diff --git a/source3/printing/print_generic.c b/source3/printing/print_generic.c index 18fca67860..cb1c951ff7 100644 --- a/source3/printing/print_generic.c +++ b/source3/printing/print_generic.c @@ -193,21 +193,24 @@ static int generic_queue_get(const char *printer_name, /* turn the lpq output into a series of job structures */ qcount = 0; ZERO_STRUCTP(status); - if (numlines) + if (numlines) { queue = SMB_MALLOC_ARRAY(print_queue_struct, numlines+1); - - if (queue) { - memset(queue, '\0', sizeof(print_queue_struct)*(numlines+1)); - for (i=0; i