Prevent overrunning the debug print overlay buffer

This commit is contained in:
Henrik Rydgard 2014-03-24 11:41:18 +01:00
parent 6260ac4bc7
commit 2240cae3bf

View file

@ -368,7 +368,7 @@ void __DisplayGetDebugStats(char stats[2048]) {
float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f;
sprintf(stats,
snprintf(stats, 2047,
"Frames: %i\n"
"DL processing time: %0.2f ms\n"
"Kernel processing time: %0.2f ms\n"
@ -417,7 +417,7 @@ void __DisplayGetDebugStats(char stats[2048]) {
gpuStats.numFragmentShaders,
gpuStats.numShaders
);
stats[2047] = '\0';
gpuStats.ResetFrame();
kernelStats.ResetFrame();
}