summaryrefslogtreecommitdiff
path: root/lib/ldb-samba
diff options
context:
space:
mode:
authorJoe Guo <joeg@catalyst.net.nz>2018-12-19 14:25:12 +1300
committerAndrew Bartlett <abartlet@samba.org>2019-03-08 00:42:18 +0000
commit3ddb5429a0b67f4867ef2730d0817d432486b15c (patch)
treeffb3b8ecc9d1121bf8fcaf9501fd781e94f8ec05 /lib/ldb-samba
parentc25e7953c6a4b26965bfbba40c793d13690ba68c (diff)
downloadsamba-3ddb5429a0b67f4867ef2730d0817d432486b15c.tar.gz
samba-o3: fix -Werror=strict-overflow error in lib/ldb-samba/ldb_ildap module
samba-o3 test failed in ubuntu:16.04 docker container: ==> /home/samba/samba/samba-o3.stderr <== ../../lib/ldb-samba/ldb_ildap.c: In function ‘ildb_handle_request’: ../../lib/ldb-samba/ldb_ildap.c:535:2: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] for (i = 0; i < n; i++) { ^ ../../lib/ldb-samba/ldb_ildap.c:579:2: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] for (i = 0; i < n; i++) { ^ cc1: all warnings being treated as errors Change type to mute errors. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/ldb-samba')
-rw-r--r--lib/ldb-samba/ldb_ildap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ldb-samba/ldb_ildap.c b/lib/ldb-samba/ldb_ildap.c
index 1b9a25ea3a7..2c32395db70 100644
--- a/lib/ldb-samba/ldb_ildap.c
+++ b/lib/ldb-samba/ldb_ildap.c
@@ -114,13 +114,13 @@ static void ildb_auto_done_callback(struct tevent_context *ev,
convert a ldb_message structure to a list of ldap_mod structures
ready for ildap_add() or ildap_modify()
*/
-static struct ldap_mod **ildb_msg_to_mods(void *mem_ctx, int *num_mods,
+static struct ldap_mod **ildb_msg_to_mods(void *mem_ctx, unsigned int *num_mods,
const struct ldb_message *msg,
int use_flags)
{
struct ldap_mod **mods;
unsigned int i;
- int n = 0;
+ unsigned int n = 0;
/* allocate maximum number of elements needed */
mods = talloc_array(mem_ctx, struct ldap_mod *, msg->num_elements+1);
@@ -504,7 +504,7 @@ static int ildb_add(struct ildb_context *ac)
struct ldb_request *req = ac->req;
struct ldap_message *msg;
struct ldap_mod **mods;
- int i,n;
+ unsigned int i,n;
msg = new_ldap_message(req);
if (msg == NULL) {
@@ -548,7 +548,7 @@ static int ildb_modify(struct ildb_context *ac)
struct ldb_request *req = ac->req;
struct ldap_message *msg;
struct ldap_mod **mods;
- int i,n;
+ unsigned int i,n;
msg = new_ldap_message(req);
if (msg == NULL) {