- 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

@ -455,51 +455,51 @@ static int EL737SGetError(struct __COUNTER *self, int *iCode,
*iCode = pPriv->errorCode;
switch (pPriv->errorCode) {
case OFFLINE:
strncpy(pError, "EL737 is offline", errLen);
strlcpy(pError, "EL737 is offline", errLen);
break;
case OVERFLOW:
strncpy(pError, "EL737 reported overflow, communication problem",
strlcpy(pError, "EL737 reported overflow, communication problem",
errLen);
break;
case BADRANGE:
strncpy(pError, "EL737 parameter is out of range", errLen);
strlcpy(pError, "EL737 parameter is out of range", errLen);
break;
case BADTRANGE:
strncpy(pError, "preset timer out of range", errLen);
strlcpy(pError, "preset timer out of range", errLen);
break;
case BADCOMMAND:
strncpy(pError, "EL737 received unknown command or is busy", errLen);
strlcpy(pError, "EL737 received unknown command or is busy", errLen);
break;
case BADPARAM:
strncpy(pError, "EL737 parameter is awful", errLen);
strlcpy(pError, "EL737 parameter is awful", errLen);
break;
case NOPARAM:
strncpy(pError, "EL737 parameter missing", errLen);
strlcpy(pError, "EL737 parameter missing", errLen);
break;
case TOMANYCOUNTS:
strncpy(pError, "EL737 counters overflowed", errLen);
strlcpy(pError, "EL737 counters overflowed", errLen);
break;
case SYSERROR:
strncpy(pError, "EL737 has an internal system error", errLen);
strlcpy(pError, "EL737 has an internal system error", errLen);
break;
case BADREPLY:
snprintf(pError, errLen, "EL737 sent an unexpected reply: %s",
pPriv->badReply);
break;
case SELECTFAIL:
strncpy(pError, "select system call failed, network trouble", errLen);
strlcpy(pError, "select system call failed, network trouble", errLen);
break;
case TIMEOUT737:
strncpy(pError,
strlcpy(pError,
"timeout or network problem while waiting for status repsonse",
errLen);
break;
case TOMANYREADERRORS:
strncpy(pError, "Failed more then three times to read counter box",
strlcpy(pError, "Failed more then three times to read counter box",
errLen);
break;
case DETOVERLOAD:
strncpy(pError, "Shutter closed due to detector overload", errLen);
strlcpy(pError, "Shutter closed due to detector overload", errLen);
break;
default:
getRS232Error(pPriv->errorCode, pError, errLen);
@ -689,7 +689,7 @@ pCounterDriver MakeEL737hpsps(SConnection * pCon, char *name,
return NULL;
}
port = atoi(argv[1]);
strncpy(pHost, argv[0], 131);
strlcpy(pHost, argv[0], 131);
/*
allocate a bank worth of memory ...........