From 3b4640dee4f96937337f2941f8ed08d8b2f8628b Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 31 May 2018 10:24:09 +0200 Subject: [PATCH] _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. --- src/frontend/plotting/grid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/plotting/grid.c b/src/frontend/plotting/grid.c index c7f1bacbf..7a5c41e74 100644 --- a/src/frontend/plotting/grid.c +++ b/src/frontend/plotting/grid.c @@ -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 -