- 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

@ -120,7 +120,7 @@ static int countTokens(char *lineBuffer)
memset(myBuffer, 0, BUFLEN);
strncpy(myBuffer, lineBuffer,BUFLEN);
strlcpy(myBuffer, lineBuffer,BUFLEN);
pPtr = myBuffer;
pPtr = stptok(pPtr, token, 60, " \r\n");
while (pPtr != NULL) {
@ -178,7 +178,7 @@ static int LMD200Callback(int handle, void *userData)
pEnd = strchr(pPtr,(int)'\r');
while(pEnd != NULL){
*pEnd = '\0';
strncpy(priv->lineBuffer,pPtr,BUFLEN);
strlcpy(priv->lineBuffer,pPtr,BUFLEN);
interpretLine(self,priv);
ANETreadConsume(priv->asChannel,(pEnd - pPtr)+1);
pPtr = ANETreadPtr(priv->asChannel,&length);
@ -216,7 +216,7 @@ int MakeLMD200(SConnection * pCon, SicsInterp * pSics, void *pData,
}
priv = (pLMD200) malloc(sizeof(LMD200));
memset(priv, 0, sizeof(LMD200));
strncpy(priv->host, argv[2], 256);
strlcpy(priv->host, argv[2], 256);
priv->port = atoi(argv[3]);
priv->asChannel = ANETconnect(priv->host, priv->port);
if (priv->asChannel < 0) {