- Changed strncpy to strlcpy, strncat to strlcat
- Added strlcpy and strlcat to SICS - Added a driver for the POLDI power supplies
This commit is contained in:
22
sanscook.c
22
sanscook.c
@ -363,7 +363,7 @@ static int CookerGetPar(pCodri self, char *parname,
|
||||
}
|
||||
|
||||
}
|
||||
strncpy(pBuffer, pBueffel, iLen);
|
||||
strlcpy(pBuffer, pBueffel, iLen);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -393,7 +393,7 @@ static int CookerGetPar(pCodri self, char *parname,
|
||||
return 0;
|
||||
}
|
||||
sprintf(pBueffel, "%f", fVal);
|
||||
strncpy(pBuffer, pBueffel, iLen);
|
||||
strlcpy(pBuffer, pBueffel, iLen);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -446,31 +446,31 @@ static int CookerError(pCodri self, int *iCode, char *pError, int iLen)
|
||||
*iCode = pPriv->iError;
|
||||
switch (pPriv->iError) {
|
||||
case NOTINIT:
|
||||
strncpy(pError, "ERROR: NOT Initialized!", iLen);
|
||||
strlcpy(pError, "ERROR: NOT Initialized!", iLen);
|
||||
break;
|
||||
case POWEROFF:
|
||||
strncpy(pError, "ERROR: Power is OFF", iLen);
|
||||
strlcpy(pError, "ERROR: Power is OFF", iLen);
|
||||
break;
|
||||
case LOWRANGE:
|
||||
strncpy(pError, "ERROR: Lower limit violated", iLen);
|
||||
strlcpy(pError, "ERROR: Lower limit violated", iLen);
|
||||
break;
|
||||
case HIGHRANGE:
|
||||
strncpy(pError, "ERROR: Upper limit violated", iLen);
|
||||
strlcpy(pError, "ERROR: Upper limit violated", iLen);
|
||||
break;
|
||||
case CONTIMEOUT:
|
||||
strncpy(pError, "ERROR: Internal controller timeout ", iLen);
|
||||
strlcpy(pError, "ERROR: Internal controller timeout ", iLen);
|
||||
break;
|
||||
case BADCOMMAND:
|
||||
strncpy(pError, "ERROR: Controller did not understand command", iLen);
|
||||
strlcpy(pError, "ERROR: Controller did not understand command", iLen);
|
||||
break;
|
||||
case BADINPUT:
|
||||
strncpy(pError, "A bad parameter was entered", iLen);
|
||||
strlcpy(pError, "A bad parameter was entered", iLen);
|
||||
break;
|
||||
case MOTERROR:
|
||||
strncpy(pError, "ERROR: Iternal motor error in controller", iLen);
|
||||
strlcpy(pError, "ERROR: Iternal motor error in controller", iLen);
|
||||
break;
|
||||
case CONBUSY:
|
||||
strncpy(pError, "ERROR: Controller is busy", iLen);
|
||||
strlcpy(pError, "ERROR: Controller is busy", iLen);
|
||||
break;
|
||||
default:
|
||||
SerialError(pPriv->iError, pError, iLen);
|
||||
|
Reference in New Issue
Block a user