CLEANUP: chunk: remove misleading chunk_strncat() function
This function claims to perform an strncat()-like operation but it does
not, it always copies the indicated number of bytes, regardless of the
presence of a NUL character (what is currently done by chunk_memcat()).
Let's remove it and explicitly replace it with chunk_memcat().
diff --git a/src/cache.c b/src/cache.c
index ee42947..9c108ae 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -779,8 +779,8 @@
if (value) {
struct buffer *chk = get_trash_chunk();
- chunk_strncat(chk, value, ctx.value.len - 8 + 1);
- chunk_strncat(chk, "", 1);
+ chunk_memcat(chk, value, ctx.value.len - 8 + 1);
+ chunk_memcat(chk, "", 1);
offset = (*chk->area == '"') ? 1 : 0;
smaxage = strtol(chk->area + offset, &endptr, 10);
if (unlikely(smaxage < 0 || endptr == chk->area))
@@ -791,8 +791,8 @@
if (value) {
struct buffer *chk = get_trash_chunk();
- chunk_strncat(chk, value, ctx.value.len - 7 + 1);
- chunk_strncat(chk, "", 1);
+ chunk_memcat(chk, value, ctx.value.len - 7 + 1);
+ chunk_memcat(chk, "", 1);
offset = (*chk->area == '"') ? 1 : 0;
maxage = strtol(chk->area + offset, &endptr, 10);
if (unlikely(maxage < 0 || endptr == chk->area))