From aea08f5dfd16396428f39cc4a02b81e6457f55f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Sved=C3=A4ng?= Date: Tue, 6 Feb 2018 19:43:12 +0100 Subject: [PATCH] Switch amount of bytes allocated. --- core/core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core.h b/core/core.h index b73a00c1..a5cd6d0e 100644 --- a/core/core.h +++ b/core/core.h @@ -297,14 +297,14 @@ char* String_cstr(string *s) { } string String_str(string *s) { - int n = strlen(*s) + 4; + int n = strlen(*s) + 1; string buffer = CARP_MALLOC(n); snprintf(buffer, n, "%s", *s); return buffer; } string String_prn(string *s) { - int n = strlen(*s) + 1; + int n = strlen(*s) + 4; string buffer = CARP_MALLOC(n); snprintf(buffer, n, "@\"%s\"", *s); return buffer;