From 6c2cafdcb0341929b62e41c62919ca958ea0f6de Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Tue, 27 Sep 2022 12:22:24 +0200 Subject: [PATCH] lib: extend sbuf size sbuf variable is used among other things to store IS-IS database output. Future commits will introduce the output of extended access groups in the "show isis database detail" output. Extend the sbuf size to have chance to store all information. Signed-off-by: Louis Scalbert --- lib/sbuf.c | 4 ++-- lib/sbuf.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/sbuf.c b/lib/sbuf.c index c04af153b..3f1b02eaf 100644 --- a/lib/sbuf.c +++ b/lib/sbuf.c @@ -33,8 +33,8 @@ void sbuf_init(struct sbuf *dest, char *buf, size_t size) dest->buf = buf; dest->size = size; } else { - dest->buf = XMALLOC(MTYPE_TMP, 4096); - dest->size = 4096; + dest->buf = XMALLOC(MTYPE_TMP, SBUF_DEFAULT_SIZE); + dest->size = SBUF_DEFAULT_SIZE; } dest->pos = 0; diff --git a/lib/sbuf.h b/lib/sbuf.h index aaa2db0ed..e5a43c0e3 100644 --- a/lib/sbuf.h +++ b/lib/sbuf.h @@ -64,6 +64,8 @@ extern "C" { * the string returned in parser_log. */ +#define SBUF_DEFAULT_SIZE 8192 + struct sbuf { bool fixed; char *buf; -- 2.39.5