- After a bug at TRICS I replaced all occurrences of strcpy, strcat, sprintf

by length limited versions wherever appropriate.
This commit is contained in:
koennecke
2009-12-04 12:58:45 +00:00
parent 09826fb097
commit 4127cbb166
9 changed files with 42 additions and 43 deletions

View File

@ -120,7 +120,7 @@ static int countTokens(char *lineBuffer)
memset(myBuffer, 0, BUFLEN);
strcpy(myBuffer, lineBuffer);
strncpy(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';
strcpy(priv->lineBuffer,pPtr);
strncpy(priv->lineBuffer,pPtr,BUFLEN);
interpretLine(self,priv);
ANETreadConsume(priv->asChannel,(pEnd - pPtr)+1);
pPtr = ANETreadPtr(priv->asChannel,&length);