1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Par.cpp: In function ‘int SidesPar(ddTableResults*, parResultsDealer*, int)’:
Par.cpp:1351:23: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]
sprintf(buff, "+%d", parm[i].contracts[k].overTricks);
^~~~~
Par.cpp:1351:16: note: ‘sprintf’ output between 3 and 12 bytes into a destination of size 11
sprintf(buff, "+%d", parm[i].contracts[k].overTricks);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- a/src/Par.cpp
+++ b/src/Par.cpp
@@ -1275,7 +1275,7 @@ int STDCALL SidesPar(
{
parResultsMaster parm[2];
int res, i, k;
- char buff[4];
+ char buff[12];
res = SidesParBin(tablep, parm, vulnerable);
|