From: Andreas Schneider Date: Fri, 18 Jan 2019 15:16:05 +0000 (+0100) Subject: s4:dsdb: Fix size types in audit_log X-Git-Tag: ldb-1.6.1~452 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ac30e77f3d0570ca0adca79be8608e0dc2fa7c2;p=thirdparty%2Fsamba.git s4:dsdb: Fix size types in audit_log audit_log.c:878:7: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] Signed-off-by: Andreas Schneider --- diff --git a/source4/dsdb/samdb/ldb_modules/audit_log.c b/source4/dsdb/samdb/ldb_modules/audit_log.c index 5d6ebc1e165..28d824acfff 100644 --- a/source4/dsdb/samdb/ldb_modules/audit_log.c +++ b/source4/dsdb/samdb/ldb_modules/audit_log.c @@ -829,7 +829,7 @@ static char *log_attributes( enum ldb_request_type operation, const struct ldb_message *message) { - int i, j; + size_t i, j; for (i=0;inum_elements;i++) { if (i > 0) { buffer = talloc_asprintf_append_buffer(buffer, " "); @@ -840,7 +840,7 @@ static char *log_attributes( ldb, LDB_DEBUG_ERROR, "Error: Invalid element name (NULL) at " - "position %d", i); + "position %zu", i); return NULL; } @@ -874,7 +874,7 @@ static char *log_attributes( for (j=0;jelements[i].num_values;j++) { struct ldb_val v; bool use_b64_encode = false; - int length; + size_t length; if (j > 0) { buffer = talloc_asprintf_append_buffer( buffer, @@ -898,8 +898,8 @@ static char *log_attributes( buffer = talloc_asprintf_append_buffer( buffer, "[%*.*s%s]", - length, - length, + (int)length, + (int)length, (char *)v.data, (v.length > MAX_LENGTH ? "..." : "")); }