diff --git a/src/atomic_counter.hpp b/src/atomic_counter.hpp
index e2e09d99645bf35903a438af68b90bee299b1019..4f2ff58449553297a73abcbffeb860a6c8710a6b 100644
--- a/src/atomic_counter.hpp
+++ b/src/atomic_counter.hpp
@@ -188,7 +188,7 @@ class atomic_counter_t
                            "+Qo"(_value)
                          : "Ir"(decrement_), "r"(&_value)
                          : "cc");
-        return old_value - decrement != 0;
+        return old_value - decrement_ != 0;
 #elif defined ZMQ_ATOMIC_COUNTER_MUTEX
         sync.lock ();
         _value -= decrement_;