summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2018-11-18 04:57:05 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2018-11-18 04:57:05 -0500
commitaba45f68d801a3002939cd36a90efe9a70811107 (patch)
treea1df252ce70c05acda25e437910804766dde7c8b /src/buffer.h
parent473ce93c144772daa0df59bb13d40c1bc08f15c1 (diff)
downloadlighttpd-git-aba45f68d801a3002939cd36a90efe9a70811107.tar.gz
[core] perf: simpler buffer_string_space() (tests)
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 53b82b00..fa887094 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -194,7 +194,7 @@ static inline size_t buffer_string_length(const buffer *b) {
}
static inline size_t buffer_string_space(const buffer *b) {
- return NULL != b ? b->size - b->used - (0 == b->used) : 0;
+ return NULL != b && b->size ? b->size - b->used - (0 == b->used) : 0;
}
static inline void buffer_append_string_buffer(buffer *b, const buffer *src) {