Skip to content

Commit 36400ac

Browse files
committed
Updated two calls to sprintf that I missed in r269.
1 parent 32ffb93 commit 36400ac

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/jsontestrunner/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static std::string
1919
normalizeFloatingPointStr( double value )
2020
{
2121
char buffer[32];
22-
sprintf( buffer, "%.16g", value );
22+
snprintf( buffer, sizeof(buffer), "%.16g", value );
2323
buffer[sizeof(buffer)-1] = 0;
2424
std::string s( buffer );
2525
std::string::size_type index = s.find_last_of( "eE" );
@@ -89,7 +89,7 @@ printValueTree( FILE *fout, Json::Value &value, const std::string &path = "." )
8989
for ( int index =0; index < size; ++index )
9090
{
9191
static char buffer[16];
92-
sprintf( buffer, "[%d]", index );
92+
snprintf( buffer, sizeof(buffer), "[%d]", index );
9393
printValueTree( fout, value[index], path + buffer );
9494
}
9595
}
@@ -290,4 +290,3 @@ int main( int argc, const char *argv[] )
290290

291291
return exitCode;
292292
}
293-

0 commit comments

Comments
 (0)