- 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:
koennecke
2010-04-13 15:08:40 +00:00
parent 9e4eabeed1
commit dec6b04fa6
49 changed files with 679 additions and 653 deletions

View File

@ -21,6 +21,7 @@
#include <conman.h>
#include <servlog.h>
#include <fortify.h>
#include <strlutil.h>
#include "evdriver.h"
#include "hardsup/el734_def.h"
@ -197,16 +198,16 @@ static int EuroError(pEVDriver self, int *iCode, char *error, int iErrLen)
*iCode = pMe->iLastError;
switch (pMe->iLastError) {
case INVALIDANSWER:
strncpy(error, "Unexpected reply from Eurotherm", iErrLen);
strlcpy(error, "Unexpected reply from Eurotherm", iErrLen);
break;
case INVALIDNUMBER:
strncpy(error, "No number in Eurotherm answer", iErrLen);
strlcpy(error, "No number in Eurotherm answer", iErrLen);
break;
case ERRNAK:
strncpy(error, "Eurothem did NOT acknowledge command", iErrLen);
strlcpy(error, "Eurothem did NOT acknowledge command", iErrLen);
break;
case NOSEND:
strncpy(error,
strlcpy(error,
"Eurotherm has a bizarre protocoll, sending things is very STUPID",
iErrLen);
break;
@ -228,7 +229,7 @@ static int EuroSend(pEVDriver self, char *pCommand, char *pReply, int iLen)
assert(pMe);
pMe->iLastError = NOSEND;
strncpy(pReply, "ERROR: Eurotherm does not support send functionality",
strlcpy(pReply, "ERROR: Eurotherm does not support send functionality",
iLen);
return 0;
}