Skip to content

Commit

Permalink
json: write null when const char* = 0
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Linev <[email protected]>
  • Loading branch information
linev authored and pcanal committed Nov 7, 2016
1 parent e984f21 commit 451bc27
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions io/io/src/TBufferJSON.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3047,9 +3047,14 @@ void TBufferJSON::JsonWriteBasic(ULong64_t value)

void TBufferJSON::JsonWriteConstChar(const char* value, Int_t len)
{
fValue.Append("\"");
if (value==0) {

fValue.Append("null");

} else {

fValue.Append("\"");

if (value!=0) {
if (len<0) len = strlen(value);

for (Int_t n=0;n<len;n++) {
Expand Down Expand Up @@ -3086,9 +3091,9 @@ void TBufferJSON::JsonWriteConstChar(const char* value, Int_t len)
fValue.Append(TString::Format("\\u%04x", (unsigned) c));
}
}
}

fValue.Append("\"");
fValue.Append("\"");
}
}


Expand Down

0 comments on commit 451bc27

Please sign in to comment.