diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2021-11-23 16:41:47 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2021-11-23 16:41:47 +0100 |
commit | 9670471dad9d245464ce97e61b57f2de05159be8 (patch) | |
tree | a4815e277a996fda6dbce61be900d40d00728b5c | |
parent | 6f4dbe911948fff928721c7b926b230abff14321 (diff) |
sfeed.1: improve a comment for string_append
-rw-r--r-- | sfeed.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |