mirror of
https://github.com/samsonjs/lake.git
synced 2026-03-25 08:55:49 +00:00
Fix missing trailing quote when displaying strings
This commit is contained in:
parent
1d44434897
commit
9bc880ae05
1 changed files with 2 additions and 1 deletions
|
|
@ -49,7 +49,8 @@ char *lake_repr(void *expr)
|
||||||
|
|
||||||
case TYPE_STR:
|
case TYPE_STR:
|
||||||
{
|
{
|
||||||
size_t n = strlen(STR_S(STR(e))) + 2;
|
// +3 for surrounding quotes and null terminator
|
||||||
|
size_t n = strlen(STR_S(STR(e))) + 3;
|
||||||
s = malloc(n);
|
s = malloc(n);
|
||||||
/* TODO: quote the string */
|
/* TODO: quote the string */
|
||||||
snprintf(s, n, "\"%s\"", STR_S(STR(e)));
|
snprintf(s, n, "\"%s\"", STR_S(STR(e)));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue