summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/src/header.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/src/header.c b/src/src/header.c
index cf7a81296..720446bff 100644
--- a/src/src/header.c
+++ b/src/src/header.c
@@ -97,12 +97,15 @@ header_add_backend(BOOL after, uschar *name, BOOL topnot, int type,
header_line *h, *new = NULL;
header_line **hptr;
-uschar *p, *q;
-uschar * buf = store_get(HEADER_ADD_BUFFER_SIZE, FALSE);
-gstring gs = { .size = HEADER_ADD_BUFFER_SIZE, .ptr = 0, .s = buf };
+uschar * p, * q, * buf;
+gstring gs;
if (!header_last) return NULL;
+gs.s = buf = store_get(HEADER_ADD_BUFFER_SIZE, FALSE);
+gs.size = HEADER_ADD_BUFFER_SIZE;
+gs.ptr = 0;
+
if (!string_vformat(&gs, SVFMT_REBUFFER, format, ap))
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "string too long in header_add: "
"%.100s ...", string_from_gstring(&gs));