Commit d84cc955 authored by Geoff Simmons's avatar Geoff Simmons

refactor the declaration and initialization of VSBs in format.c

parent c1ffcdd6
...@@ -52,8 +52,8 @@ typedef struct compiled_fmt_t { ...@@ -52,8 +52,8 @@ typedef struct compiled_fmt_t {
unsigned n; unsigned n;
} compiled_fmt_t; } compiled_fmt_t;
static struct vsb *payload; static struct vsb payload_storage, * const payload = &payload_storage,
static struct vsb *bintag; bintag_storage, * const bintag = &bintag_storage;
static char *scratch = NULL; static char *scratch = NULL;
static char empty[] = ""; static char empty[] = "";
...@@ -1200,13 +1200,8 @@ FMT_Init(char *err) ...@@ -1200,13 +1200,8 @@ FMT_Init(char *err)
if (scratch == NULL) if (scratch == NULL)
return errno; return errno;
payload = VSB_new(NULL, NULL, config.max_reclen + 1, VSB_FIXEDLEN); AN(VSB_new(payload, NULL, config.max_reclen + 1, VSB_FIXEDLEN));
if (payload == NULL) AN(VSB_new(bintag, NULL, config.max_reclen + 1, VSB_FIXEDLEN));
return ENOMEM;
bintag = VSB_new(NULL, NULL, config.max_reclen + 1, VSB_FIXEDLEN);
if (bintag == NULL)
return ENOMEM;
includes = 0; includes = 0;
for (int i = 0; i < MAX_VSL_TAG; i++) { for (int i = 0; i < MAX_VSL_TAG; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment