- 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

@@ -880,29 +880,29 @@ static void ECBGetError(void *pData, int *iCode, char *buffer,
*iCode = self->errorCode;
switch (self->errorCode) {
case COMMERROR:
strncpy(buffer, "communication problem with ECB", bufferlen);
strlcpy(buffer, "communication problem with ECB", bufferlen);
break;
case ECBMANUELL:
strncpy(buffer, "ECB is in manual mode, trying to switch...",
strlcpy(buffer, "ECB is in manual mode, trying to switch...",
bufferlen);
break;
case ECBINUSE:
strncpy(buffer, "Power supply is in use", bufferlen);
strlcpy(buffer, "Power supply is in use", bufferlen);
break;
case ECBINHIBIT:
strncpy(buffer, "motor is inhibited", bufferlen);
strlcpy(buffer, "motor is inhibited", bufferlen);
break;
case ECBRUNNING:
strncpy(buffer, "motor is running", bufferlen);
strlcpy(buffer, "motor is running", bufferlen);
break;
case ECBSTART:
strncpy(buffer, "failed to start motor", bufferlen);
strlcpy(buffer, "failed to start motor", bufferlen);
break;
case ECBLIMIT:
strncpy(buffer, "hit limit switch or amplifier error", bufferlen);
strlcpy(buffer, "hit limit switch or amplifier error", bufferlen);
break;
default:
strncpy(buffer, "unidentified error code", bufferlen);
strlcpy(buffer, "unidentified error code", bufferlen);
break;
}
}