mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-19 00:46:02 +01:00
Updated two calls to sprintf that I missed in r269.
This commit is contained in:
parent
32ffb931e7
commit
36400ac0c1
@ -19,7 +19,7 @@ static std::string
|
||||
normalizeFloatingPointStr( double value )
|
||||
{
|
||||
char buffer[32];
|
||||
sprintf( buffer, "%.16g", value );
|
||||
snprintf( buffer, sizeof(buffer), "%.16g", value );
|
||||
buffer[sizeof(buffer)-1] = 0;
|
||||
std::string s( buffer );
|
||||
std::string::size_type index = s.find_last_of( "eE" );
|
||||
@ -89,7 +89,7 @@ printValueTree( FILE *fout, Json::Value &value, const std::string &path = "." )
|
||||
for ( int index =0; index < size; ++index )
|
||||
{
|
||||
static char buffer[16];
|
||||
sprintf( buffer, "[%d]", index );
|
||||
snprintf( buffer, sizeof(buffer), "[%d]", index );
|
||||
printValueTree( fout, value[index], path + buffer );
|
||||
}
|
||||
}
|
||||
@ -290,4 +290,3 @@ int main( int argc, const char *argv[] )
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user