diff options
author | cypherpunks <cypherpunks@torproject.org> | 2020-03-12 16:02:00 +0000 |
---|---|---|
committer | cypherpunks <cypherpunks@torproject.org> | 2020-03-24 05:53:01 +0000 |
commit | f46b9320ae32f00aa97a397b33eaa7abdcb47fe3 (patch) | |
tree | 504450562293912a2652b24ee6ef09a78020707c /src/lib/buf | |
parent | d3ded1cc1c4a1bcd158c1705c4c26425ed538be9 (diff) | |
download | tor-f46b9320ae32f00aa97a397b33eaa7abdcb47fe3.tar.gz tor-f46b9320ae32f00aa97a397b33eaa7abdcb47fe3.zip |
buf: add BUF_MAX_LEN
Diffstat (limited to 'src/lib/buf')
-rw-r--r-- | src/lib/buf/buffers.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/buf/buffers.h b/src/lib/buf/buffers.h index fadd4174c0..d8a77feb72 100644 --- a/src/lib/buf/buffers.h +++ b/src/lib/buf/buffers.h @@ -29,6 +29,9 @@ void buf_free_(buf_t *buf); void buf_clear(buf_t *buf); buf_t *buf_copy(const buf_t *buf); +/** Maximum bytes in a buffer, inclusive. */ +#define BUF_MAX_LEN (INT_MAX - 1) + MOCK_DECL(size_t, buf_datalen, (const buf_t *buf)); size_t buf_allocation(const buf_t *buf); size_t buf_slack(const buf_t *buf); |