- fixed some potential bugs introduced when replacing strncpy and

strncat by strlcpy and strlcat
This commit is contained in:
zolliker
2010-04-14 08:46:17 +00:00
parent 1c558e7f6c
commit 9690db1c3d
10 changed files with 20 additions and 20 deletions

View File

@ -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);