Bug 720016 - warning when compiling the maintenance service - swprintf takes a count parameter. r=bbondy

This commit is contained in:
Robert Strong 2012-01-22 15:55:22 -08:00
parent fd28c7afb5
commit b4a0cbf1ca

View File

@ -186,9 +186,11 @@ GetBackupLogPath(LPWSTR path, LPCWSTR basePath, int logNumber)
WCHAR logName[64];
wcscpy(path, basePath);
if (logNumber <= 0) {
swprintf(logName, L"maintenanceservice.log");
swprintf(logName, sizeof(logName) / sizeof(logName[0]),
L"maintenanceservice.log");
} else {
swprintf(logName, L"maintenanceservice-%d.log", logNumber);
swprintf(logName, sizeof(logName) / sizeof(logName[0]),
L"maintenanceservice-%d.log", logNumber);
}
return PathAppendSafe(path, logName);
}