Fix possible buffer overruns
This commit is contained in:
@ -346,7 +346,7 @@
|
|||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
int WEST4100_Query(pWEST4100 *pData, int parAddress, int *parValue)
|
int WEST4100_Query(pWEST4100 *pData, int parAddress, int *parValue)
|
||||||
{
|
{
|
||||||
unsigned char pCommand[20], pReply[132], pAddress[1];
|
unsigned char pCommand[20], pReply[132], pAddress[2];
|
||||||
int iRet;
|
int iRet;
|
||||||
pWEST4100 self;
|
pWEST4100 self;
|
||||||
|
|
||||||
@ -374,7 +374,7 @@
|
|||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
int WEST4100_Write(pWEST4100 *pData, int parAddress, int parValue)
|
int WEST4100_Write(pWEST4100 *pData, int parAddress, int parValue)
|
||||||
{
|
{
|
||||||
unsigned char displaytext[20];
|
unsigned char displaytext[40];
|
||||||
int iRet;
|
int iRet;
|
||||||
pWEST4100 self;
|
pWEST4100 self;
|
||||||
|
|
||||||
|
@ -5445,8 +5445,7 @@ int DMC2280Action(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} else if(self->abs_encoder && strcasecmp("stats", argv[1]) == 0) {
|
} else if(self->abs_encoder && strcasecmp("stats", argv[1]) == 0) {
|
||||||
char line[132];
|
SCPrintf(pCon, eValue, "%s.stats=%s samples=%.0f, slope=%f, intercept=%f, r=%f, stepsPerX=%f",
|
||||||
snprintf(line, CMDLEN, "%s.stats=%s samples=%.0f, slope=%f, intercept=%f, r=%f, stepsPerX=%f",
|
|
||||||
self->name,
|
self->name,
|
||||||
self->doStats ? "ON" : "OFF",
|
self->doStats ? "ON" : "OFF",
|
||||||
self->S_n,
|
self->S_n,
|
||||||
@ -5454,7 +5453,6 @@ int DMC2280Action(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
self->S_b,
|
self->S_b,
|
||||||
self->S_r,
|
self->S_r,
|
||||||
self->cntsPerX * self->S_m);
|
self->cntsPerX * self->S_m);
|
||||||
SCWrite(pCon, line, eValue);
|
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
if (strcasecmp(argv[2], "reset") == 0) {
|
if (strcasecmp(argv[2], "reset") == 0) {
|
||||||
/* reset the stats */
|
/* reset the stats */
|
||||||
|
Reference in New Issue
Block a user