- fixed some potential bugs introduced when replacing strncpy and
strncat by strlcpy and strlcat
This commit is contained in:
@ -99,7 +99,7 @@ static int TclRun(void *self, float fVal)
|
||||
return HWFault;
|
||||
}
|
||||
snprintf(num, 79, "%f", fVal);
|
||||
strlcat(tclCommand, num, 1023 - strlen(tclCommand));
|
||||
strlcat(tclCommand, num, sizeof tclCommand);
|
||||
|
||||
status = Tcl_Eval(pServ->pSics->pTcl, tclCommand);
|
||||
result = Tcl_GetStringResult(pServ->pSics->pTcl);
|
||||
@ -199,7 +199,7 @@ static int TclFix(void *self, int iError, float fNew)
|
||||
return HWFault;
|
||||
}
|
||||
snprintf(num, 79, "%d %f", pDriv->errorCode, fNew);
|
||||
strlcat(tclCommand, num, 1023 - strlen(tclCommand));
|
||||
strlcat(tclCommand, num, sizeof tclCommand);
|
||||
|
||||
status = Tcl_Eval(pServ->pSics->pTcl, tclCommand);
|
||||
result = Tcl_GetStringResult(pServ->pSics->pTcl);
|
||||
|
Reference in New Issue
Block a user