- 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

@@ -57,11 +57,11 @@ static int TableDriveCheckLimits(void *pData, float fVal, char *error,
tdMotor moti;
if (self == NULL || self->motorTable < 0) {
strncpy(error, "Path Table Not Defined!", 25);
strlcpy(error, "Path Table Not Defined!", 25);
return 0;
}
if (fVal < 1. || fVal > self->tableLength) {
strncpy(error, "Out of Range", 25);
strlcpy(error, "Out of Range", 25);
return 0;
}
return 1;
@@ -537,7 +537,7 @@ static int startASDS(pTableDrive self, SConnection * pCon, int target)
status = LLDnodePtr2First(self->motorTable);
while (status != 0) {
LLDnodeDataTo(self->motorTable, &moti);
strncpy(name, moti.motorName, 131);
strlcpy(name, moti.motorName, 131);
strtolower(name);
if (strstr(name, "ds") != NULL || strstr(name, "as") != NULL) {
if (target == ASDSTO0) {
@@ -570,7 +570,7 @@ static int startOthers(pTableDrive self, SConnection * pCon)
status = LLDnodePtr2First(self->motorTable);
while (status != 0) {
LLDnodeDataTo(self->motorTable, &moti);
strncpy(name, moti.motorName, 131);
strlcpy(name, moti.motorName, 131);
strtolower(name);
if (strstr(name, "ds") == NULL && strstr(name, "as") == NULL) {
targetValue = findTarget(moti, self->targetPosition);
@@ -929,7 +929,7 @@ int TableDriveAction(SConnection * pCon, SicsInterp * pSics, void *pData,
if (!SCMatchRights(pCon, usMugger)) {
return 0;
}
strncpy(self->orientMotor, argv[2], 80);
strlcpy(self->orientMotor, argv[2], 80);
self->oriInvalid = 1;
SCSendOK(pCon);
return 1;