ldb: Fix size types in ldb_ldif functions
authorAndreas Schneider <asn@samba.org>
Fri, 8 Dec 2017 09:03:00 +0000 (10:03 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 20 Mar 2018 22:16:16 +0000 (23:16 +0100)
This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/common/ldb_ldif.c

index b90d27eea59d6d597c383b275744682570c67b52..e23b568707d5c99d83bbf6defa928b05bfb7a945 100644 (file)
@@ -216,7 +216,8 @@ static int fold_string(int (*fprintf_fn)(void *, const char *, ...), void *priva
                        const char *buf, size_t length, int start_pos)
 {
        size_t i;
-       int total=0, ret;
+       size_t total = 0;
+       int ret;
 
        for (i=0;i<length;i++) {
                ret = fprintf_fn(private_data, "%c", buf[i]);
@@ -280,7 +281,8 @@ static int ldb_ldif_write_trace(struct ldb_context *ldb,
 {
        TALLOC_CTX *mem_ctx;
        unsigned int i, j;
-       int total=0, ret;
+       size_t total = 0;
+       int ret;
        char *p;
        const struct ldb_message *msg;
        const char * const * secret_attributes = ldb_get_opaque(ldb, LDB_SECRET_ATTRIBUTE_LIST_OPAQUE);