From a47a562322d52275b0bae7181a5077cf95b24ffb Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Thu, 14 Feb 2019 09:54:54 +0100 Subject: Fix empty dynamic string Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/strings.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/strings.c b/src/strings.c index 6601a99..a84f836 100644 --- a/src/strings.c +++ b/src/strings.c @@ -45,6 +45,7 @@ void string_init(struct string *sb) sb->buf = mem_malloc(STRING_INITIAL_BUFSIZE); sb->bufsize = STRING_INITIAL_BUFSIZE; sb->len = 0; + *sb->buf = '\0'; } void string_reset(struct string *sb) -- cgit v1.2.3-70-g09d2