Skip to content

Commit

Permalink
buffer: simplify buffer_content0
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Apr 18, 2017
1 parent e5f3617 commit 22bb54a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 22bb54a

Please sign in to comment.