- 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:
6
lmd200.c
6
lmd200.c
@ -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) {
|
||||
|
Reference in New Issue
Block a user