diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/format.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/format.c b/src/format.c index 96cdb0e..2c97b72 100644 --- a/src/format.c +++ b/src/format.c @@ -226,6 +226,7 @@ grecs_format_value(struct grecs_value *val, int flags, FILE *fp) char *cbuf = grecs_malloc(clen + 1); wordsplit_c_quote_copy(cbuf, val->v.string, flags & GRECS_NODE_FLAG_QUOTE_HEX); + cbuf[clen] = 0; fprintf(fp, "\"%s\"", cbuf); free(cbuf); } else |