- fixed some potential bugs introduced when replacing strncpy and

strncat by strlcpy and strlcat
This commit is contained in:
zolliker
2010-04-14 08:46:17 +00:00
parent 1c558e7f6c
commit 9690db1c3d
10 changed files with 20 additions and 20 deletions

8
scan.c
View File

@ -1396,16 +1396,16 @@ static void PrintScanVars(pScanData self, char *scanname,
assert(pCon);
assert(self);
snprintf(pBueffel, 1023, "%s.scanvars = { ", scanname);
snprintf(pBueffel, sizeof pBueffel, "%s.scanvars = { ", scanname);
for (i = 0; i < self->iScanVar; i++) {
DynarGet(self->pScanVar, i, &pPtr);
pVar = (pVarEntry) pPtr;
if (pVar != NULL) {
strlcat(pBueffel, ScanVarName(pVar), 1023 - strlen(pBueffel));
strcat(pBueffel, " ");
strlcat(pBueffel, ScanVarName(pVar), sizeof pBueffel);
strlcat(pBueffel, " ", sizeof pBueffel);
}
}
strcat(pBueffel, "}");
strlcat(pBueffel, "}", sizeof pBueffel);
SCWrite(pCon, pBueffel, eValue);
}