From 9670471dad9d245464ce97e61b57f2de05159be8 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 23 Nov 2021 16:41:47 +0100 Subject: sfeed.1: improve a comment for string_append --- sfeed.c | 4 ++-- 1 file 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); -- cgit v1.2.3