On Thu, 04 Mar 2010, Gregor Hoffleit wrote:
> -     printf (", \"content\": %s", json_quote_str (ctx, (char *) 
> part_content->data));
> +     content_data = talloc_size (ctx, part_content->len+1);
> +     memcpy (content_data, (char *)part_content->data, part_content->len+1);
> +     content_data[part_content->len] = 0;
> +     printf (", \"content\": %s", json_quote_str (ctx, content_data));

What about modifying json_quote_str() to accept additional parameter
len? If I have 10MB attachment to the email, this unnecessary copy is
quite expensive, isn't it?

--Michal

Reply via email to