Commit 75444d97fd5bc13be922714f2977a483c5303286

Edward Thomson 2019-01-20T13:52:46

add with overflow: correct documentation Correct the documentation on the fallback add/multiply with overflow functions.

diff --git a/src/integer.h b/src/integer.h
index 12e71f7..10b1097 100644
--- a/src/integer.h
+++ b/src/integer.h
@@ -79,7 +79,7 @@ GIT_INLINE(int) git__is_int(long long p)
 
 /**
  * Sets `one + two` into `out`, unless the arithmetic would overflow.
- * @return true if the result fits in a `size_t`, false on overflow.
+ * @return false if the result fits in a `size_t`, true on overflow.
  */
 GIT_INLINE(bool) git__add_sizet_overflow(size_t *out, size_t one, size_t two)
 {
@@ -91,7 +91,7 @@ GIT_INLINE(bool) git__add_sizet_overflow(size_t *out, size_t one, size_t two)
 
 /**
  * Sets `one * two` into `out`, unless the arithmetic would overflow.
- * @return true if the result fits in a `size_t`, false on overflow.
+ * @return false if the result fits in a `size_t`, true on overflow.
  */
 GIT_INLINE(bool) git__multiply_sizet_overflow(size_t *out, size_t one, size_t two)
 {