[PATCHES] patches for printing, winspool idl and hresults

Andreas Schneider asn at samba.org
Mon Sep 26 20:29:03 UTC 2016


On Monday, 26 September 2016 18:49:04 CEST Günther Deschner wrote:
> Hi,
> 
> please review and push.

Hi Günther,

could you please apply our coding conventions.

+	struct tm tm;
+	time_t t;
+
+	if (strequal(str, "01/01/1601")) {
+		*data = 0;
+		return true;
+	}
+
+	ZERO_STRUCT(tm);

Please use

struct tm tm = {0};

which avoids a memset() call here.

and then

+ if (sscanf(str, "%u.%u.%u.%u", &v1, &v2, &v3, &v4) != 4) {

should be

int rc;

rc = sscanf(str, "%u.%u.%u.%u", &v1, &v2, &v3, &v4);
if (rc != 4)

for better debugability. Note that there are several scanf calls which should 
be like this.


Thank,

	-- andreas



More information about the samba-technical mailing list