aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/buffer.c b/buffer.c
index 6e3dc9d..ffda00f 100644
--- a/buffer.c
+++ b/buffer.c
@@ -172,7 +172,7 @@ const char *buffer_content(Buffer *buf) {
}
const char *buffer_content0(Buffer *buf) {
- if (buf->len == 0 || (buf->data[buf->len-1] != '\0' && !buffer_append(buf, "\0", 1)))
+ if (buf->len == 0 || !buffer_terminate(buf))
return "";
return buf->data;
}