Skip to content

Commit 75444d9

Browse files
committed
add with overflow: correct documentation
Correct the documentation on the fallback add/multiply with overflow functions.
1 parent abbc07f commit 75444d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/integer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ GIT_INLINE(int) git__is_int(long long p)
7979

8080
/**
8181
* Sets `one + two` into `out`, unless the arithmetic would overflow.
82-
* @return true if the result fits in a `size_t`, false on overflow.
82+
* @return false if the result fits in a `size_t`, true on overflow.
8383
*/
8484
GIT_INLINE(bool) git__add_sizet_overflow(size_t *out, size_t one, size_t two)
8585
{
@@ -91,7 +91,7 @@ GIT_INLINE(bool) git__add_sizet_overflow(size_t *out, size_t one, size_t two)
9191

9292
/**
9393
* Sets `one * two` into `out`, unless the arithmetic would overflow.
94-
* @return true if the result fits in a `size_t`, false on overflow.
94+
* @return false if the result fits in a `size_t`, true on overflow.
9595
*/
9696
GIT_INLINE(bool) git__multiply_sizet_overflow(size_t *out, size_t one, size_t two)
9797
{

0 commit comments

Comments
 (0)