keytab: Avoid use of signed integer as a boolean

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 <abartlet@samba.org>
This commit is contained in:
Andrew Bartlett
2018-09-17 12:51:24 -07:00
committed by Luke Howard
parent 59aee7cad2
commit a3d8951df5

View File

@@ -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,