From 21f411b861f1e84f9b2140fdc222bf43965424db Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 9 Mar 2011 07:52:13 +0100 Subject: [PATCH] Use a boolean expression for refcount check, fixes refcounting if bool is a signed char --- src/libstrongswan/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstrongswan/utils.c b/src/libstrongswan/utils.c index 2ab061a74..ba12cd764 100644 --- a/src/libstrongswan/utils.c +++ b/src/libstrongswan/utils.c @@ -287,7 +287,7 @@ bool ref_put(refcount_t *ref) bool more_refs; pthread_mutex_lock(&ref_mutex); - more_refs = --(*ref); + more_refs = --(*ref) > 0; pthread_mutex_unlock(&ref_mutex); return !more_refs; }