[PATCH] json: Avoid calling strlen(NULL)
David Edmondson
dme at dme.org
Tue Apr 6 01:31:09 PDT 2010
On Tue, 6 Apr 2010 18:17:44 +1000, Anthony Towns <aj at erisian.com.au> wrote:
> OTOH, the code in json_quote_array to deal with that does the same
> thing (returns a literal string containing two quote marks), which
> seems wrong -- the normal code path is to talloc to get a newly
> allocated, editable string, that might be talloc_free'd later,
> wouldn't it make more sense just to let the str==NULL / len==0
> behaviour fall through into the normal case code?
This is a much nicer solution.
dme.
--
David Edmondson, http://dme.org
More information about the notmuch
mailing list