Switch amount of bytes allocated.

This commit is contained in:
Erik Svedäng 2018-02-06 19:43:12 +01:00
parent f9926f732e
commit aea08f5dfd

View File

@ -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;