aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-03-09 07:52:13 +0100
committerMartin Willi <martin@revosec.ch>2011-03-09 07:52:13 +0100
commit21f411b861f1e84f9b2140fdc222bf43965424db (patch)
tree81361b311724a26409f87304491fc8888924fa72 /src/libstrongswan/utils.c
parent5f47296f2249bf50c45c13de52e65a083f8b3cb2 (diff)
downloadstrongswan-21f411b861f1e84f9b2140fdc222bf43965424db.tar.bz2
strongswan-21f411b861f1e84f9b2140fdc222bf43965424db.tar.xz
Use a boolean expression for refcount check, fixes refcounting if bool is a signed char
Diffstat (limited to 'src/libstrongswan/utils.c')
-rw-r--r--src/libstrongswan/utils.c2
1 files changed, 1 insertions, 1 deletions
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;
}