diff options
author | David Edmondson <dme@dme.org> | 2010-04-05 10:33:19 +0100 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-04-05 10:57:23 -0700 |
commit | 9eb360329929258fb243cfb5095989ba45391109 (patch) | |
tree | 3315907a0b75a377e48a4ea44fd237307681122f /notmuch-show.c | |
parent | bb5211684654b7cf54f842990a733a64fe01d612 (diff) |
notmuch: Correctly terminate text/* parts in JSON output
Text parts returned by `g_mime_stream_mem_get_byte_array()' are not
NULL terminated strings - add `json_quote_chararray()' to handle them
correctly.
Diffstat (limited to 'notmuch-show.c')
-rw-r--r-- | notmuch-show.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/notmuch-show.c b/notmuch-show.c index e317d19..76873a1 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -326,7 +326,7 @@ format_part_json (GMimeObject *part, int *part_count) show_part_content (part, stream_memory); part_content = g_mime_stream_mem_get_byte_array (GMIME_STREAM_MEM (stream_memory)); - printf (", \"content\": %s", json_quote_str (ctx, (char *) part_content->data)); + printf (", \"content\": %s", json_quote_chararray (ctx, (char *) part_content->data, part_content->len)); } fputs ("}", stdout); |