From a3d8951df560fd1baaedd7e3392953e40ef72077 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 17 Sep 2018 12:51:24 -0700 Subject: [PATCH] keytab: Avoid use of signed integer as a boolean MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit with CFLAGS="-O3 -Werror=strict-overflow -Wstrict-overflow=2" gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) gives: keytab_any.c: In function ‘any_remove_entry’: keytab_any.c:241:7: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow] if(!found) ^ Signed-off-by: Andrew Bartlett --- lib/krb5/keytab_any.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/krb5/keytab_any.c b/lib/krb5/keytab_any.c index eea5d64bf..6663d171f 100644 --- a/lib/krb5/keytab_any.c +++ b/lib/krb5/keytab_any.c @@ -222,11 +222,11 @@ any_remove_entry(krb5_context context, { struct any_data *a = id->data; krb5_error_code ret; - int found = 0; + krb5_boolean found = FALSE; while(a != NULL) { ret = krb5_kt_remove_entry(context, a->kt, entry); if(ret == 0) - found++; + found = TRUE; else { if(ret != KRB5_KT_NOWRITE && ret != KRB5_KT_NOTFOUND) { krb5_set_error_message(context, ret,