Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,15 @@ static cJSON_bool print_value(const cJSON * const item, printbuffer * const outp
{
return false;
}
strcpy((char*)output, "null");
//
// this modifications are made because the strcpy does not work in some cases
*output++ = 'n';
*output++ = 'u';
*output++ = 'l';
*output++ = 'l';
*output = '\0';
// this does not work
//strcpy((char*)output, "null");
return true;

case cJSON_False:
Expand All @@ -1395,7 +1403,16 @@ static cJSON_bool print_value(const cJSON * const item, printbuffer * const outp
{
return false;
}
strcpy((char*)output, "false");
//
// this modifications are made because the strcpy does not work in some cases
*output++ = 'f';
*output++ = 'a';
*output++ = 'l';
*output++ = 's';
*output++ = 'e';
*output = '\0';
// this does not work
//strcpy((char*)output, "false");
return true;

case cJSON_True:
Expand All @@ -1404,7 +1421,15 @@ static cJSON_bool print_value(const cJSON * const item, printbuffer * const outp
{
return false;
}
strcpy((char*)output, "true");
//
// this modifications are made because the strcpy does not work in some cases
*output++ = 't';
*output++ = 'r';
*output++ = 'u';
*output++ = 'e';
*output = '\0';
// this does not work
//strcpy((char*)output, "true");
return true;

case cJSON_Number:
Expand Down
Loading