- 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

@@ -342,17 +342,17 @@ static int EL737GetError(struct __COUNTER *self, int *iCode,
char pBueffel[256];
if (self->iErrorCode == UNKNOWNPAR) {
strncpy(error, "unknown internal parameter code", iErrLen);
strlcpy(error, "unknown internal parameter code", iErrLen);
*iCode = self->iErrorCode;
self->iErrorCode = 0;
return 1;
} else if (self->iErrorCode == BADCOUNTER) {
strncpy(error, "monitor cannot be selected", iErrLen);
strlcpy(error, "monitor cannot be selected", iErrLen);
*iCode = self->iErrorCode;
self->iErrorCode = 0;
return 1;
} else if (self->iErrorCode == BADTRANGE) {
strncpy(error, "preset time out of range", iErrLen);
strlcpy(error, "preset time out of range", iErrLen);
*iCode = self->iErrorCode;
self->iErrorCode = 0;
return 1;
@@ -362,7 +362,7 @@ static int EL737GetError(struct __COUNTER *self, int *iCode,
EL737_ErrInfo(&pErr, &iC1, &iC2, &iC3);
EL737Error2Text(pBueffel, iC1);
strncpy(error, pBueffel, iErrLen);
strlcpy(error, pBueffel, iErrLen);
*iCode = iC1;
return 1;
}
@@ -545,7 +545,7 @@ static int EL737Send(struct __COUNTER *self, char *pText, char *pReply,
/* ensure a \r at the end of the text */
if (strlen(pText) > 254) {
strncpy(pReply, "Command to long", iReplyLen);
strlcpy(pReply, "Command to long", iReplyLen);
return 1;
}
strcpy(pBuffer, pText);