diff --git a/connector/c/include/tp.h b/connector/c/include/tp.h
index e5a3490e1137b9faddda3ed027e5221252c3dc25..934c9a68575cc9e66151a89f07fc992329157a40 100644
--- a/connector/c/include/tp.h
+++ b/connector/c/include/tp.h
@@ -494,7 +494,7 @@ tp_reqbuf(char *buf, size_t size) {
 	register int sz =
 		((struct tp_h*)buf)->len + sizeof(struct tp_h);
 	return (tp_likely(size < sz)) ?
-	                  sz - size : size - sz;
+	                  sz - size : -(size - sz);
 }
 
 static inline ssize_t