mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-17 00:30:04 +00:00
[PVS-Studio] Fix sprintf() security warnings Bug #301
This commit is contained in:
parent
550b230ad8
commit
81c649d621
@ -57,5 +57,5 @@ void LogFileOutput(LPCTSTR format, ...)
|
|||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
|
|
||||||
_vsntprintf(output, sizeof(output) - 1, format, args);
|
_vsntprintf(output, sizeof(output) - 1, format, args);
|
||||||
fprintf(g_fh, output);
|
fprintf(g_fh, "%s", output);
|
||||||
}
|
}
|
||||||
|
@ -826,7 +826,7 @@ static void MB_Update()
|
|||||||
double fTicksSecs = (double)GetTickCount() / 1000.0;
|
double fTicksSecs = (double)GetTickCount() / 1000.0;
|
||||||
sprintf(szDbg, "%010.3f: [MBUpdt] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X xxx\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples);
|
sprintf(szDbg, "%010.3f: [MBUpdt] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X xxx\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples);
|
||||||
OutputDebugString(szDbg);
|
OutputDebugString(szDbg);
|
||||||
if (g_fh) fprintf(g_fh, szDbg);
|
if (g_fh) fprintf(g_fh, "%s", szDbg);
|
||||||
|
|
||||||
dwByteOffset = dwCurrentWriteCursor;
|
dwByteOffset = dwCurrentWriteCursor;
|
||||||
}
|
}
|
||||||
@ -839,7 +839,7 @@ static void MB_Update()
|
|||||||
double fTicksSecs = (double)GetTickCount() / 1000.0;
|
double fTicksSecs = (double)GetTickCount() / 1000.0;
|
||||||
sprintf(szDbg, "%010.3f: [MBUpdt] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X XXX\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples);
|
sprintf(szDbg, "%010.3f: [MBUpdt] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X XXX\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples);
|
||||||
OutputDebugString(szDbg);
|
OutputDebugString(szDbg);
|
||||||
if (g_fh) fprintf(g_fh, szDbg);
|
if (g_fh) fprintf(g_fh, "%s", szDbg);
|
||||||
|
|
||||||
dwByteOffset = dwCurrentWriteCursor;
|
dwByteOffset = dwCurrentWriteCursor;
|
||||||
}
|
}
|
||||||
|
@ -1045,7 +1045,7 @@ DWORD WINAPI CSuperSerialCard::CommThread(LPVOID lpParameter)
|
|||||||
sprintf(szDbg, "CommThread: Err=Other (0x%08X): InQueue=0x%08X, OutQueue=0x%08X\n", dwErrors, Stat.cbInQue, Stat.cbOutQue);
|
sprintf(szDbg, "CommThread: Err=Other (0x%08X): InQueue=0x%08X, OutQueue=0x%08X\n", dwErrors, Stat.cbInQue, Stat.cbOutQue);
|
||||||
OutputDebugString(szDbg);
|
OutputDebugString(szDbg);
|
||||||
if (g_fh)
|
if (g_fh)
|
||||||
fprintf(g_fh, szDbg);
|
fprintf(g_fh, "%s", szDbg);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -886,7 +886,7 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples)
|
|||||||
double fTicksSecs = (double)GetTickCount() / 1000.0;
|
double fTicksSecs = (double)GetTickCount() / 1000.0;
|
||||||
sprintf(szDbg, "%010.3f: [Submit] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X XXX\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples);
|
sprintf(szDbg, "%010.3f: [Submit] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X XXX\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples);
|
||||||
OutputDebugString(szDbg);
|
OutputDebugString(szDbg);
|
||||||
if (g_fh) fprintf(g_fh, szDbg);
|
if (g_fh) fprintf(g_fh, "%s", szDbg);
|
||||||
|
|
||||||
dwByteOffset = dwCurrentWriteCursor;
|
dwByteOffset = dwCurrentWriteCursor;
|
||||||
nNumSamplesError = 0;
|
nNumSamplesError = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user