From b6ac928a53d146233741fc5f7fe1cac66de27303 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 14 Dec 2014 10:27:32 -0500 Subject: Stop allocating an extra wasted byte at the end of various strings. --- gawkapi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gawkapi.h') diff --git a/gawkapi.h b/gawkapi.h index d8215450..b9dc2c0b 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -791,7 +791,7 @@ r_make_string(const gawk_api_t *api, /* needed for emalloc */ result->str_value.len = length; if (duplicate) { - emalloc(cp, char *, length + 2, "r_make_string"); + emalloc(cp, char *, length + 1, "r_make_string"); memcpy(cp, string, length); cp[length] = '\0'; result->str_value.str = cp; -- cgit v1.2.3