mirror of
https://github.com/carp-lang/Carp.git
synced 2024-10-26 13:51:50 +03:00
Switch amount of bytes allocated.
This commit is contained in:
parent
f9926f732e
commit
aea08f5dfd
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user