_snprintf in Windows 7 does not automatically put a '\0'

to the end of the buffer, only if there is space available.
That will change in the future if Snprintf is used.
This commit is contained in:
Holger Vogt 2018-05-31 10:24:09 +02:00
parent 732c684756
commit 3b4640dee4
1 changed files with 1 additions and 1 deletions

View File

@ -527,7 +527,7 @@ drawlingrid(GRAPH *graph, char *units, int spacing, int nsp, double dst, double
if (j == 0)
SetLinestyle(1);
snprintf(buf, sizeof(buf), "%.*f", digits + 1, m * mag / 100.0);
snprintf(buf, sizeof(buf) - 1, "%.*f", digits + 1, m * mag / 100.0);
if (axis == x_axis)
DevDrawText(buf, graph->viewportxoff + i -