summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2021-11-23 16:41:47 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2021-11-23 16:41:47 +0100
commit9670471dad9d245464ce97e61b57f2de05159be8 (patch)
treea4815e277a996fda6dbce61be900d40d00728b5c
parent6f4dbe911948fff928721c7b926b230abff14321 (diff)
sfeed.1: improve a comment for string_append
-rw-r--r--sfeed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sfeed.c b/sfeed.c
index 6042cb1..2509562 100644
--- a/sfeed.c
+++ b/sfeed.c
@@ -288,6 +288,7 @@ string_buffer_realloc(String *s, size_t newlen)
s->bufsiz = alloclen;
}
+/* Append data to String, s->data and data may not overlap. */
static void
string_append(String *s, const char *data, size_t len)
{
@@ -299,8 +300,7 @@ string_append(String *s, const char *data, size_t len)
err(1, "realloc");
}
- /* check if allocation is necessary, don't shrink buffer,
- * should be more than bufsiz of course. */
+ /* check if allocation is necessary, never shrink the buffer. */
if (s->len + len >= s->bufsiz)
string_buffer_realloc(s, s->len + len + 1);
memcpy(s->data + s->len, data, len);