From 417dbfef726a6da133a002539cefd18c0a872d36 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 31 May 2018 10:42:11 +0200 Subject: [PATCH] undo the previous commits dealing with snprintf, use the C99 compliant function also with MS Visual Studio --- src/frontend/plotting/grid.c | 2 +- src/include/ngspice/graph.h | 2 +- src/include/ngspice/ngspice.h | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/frontend/plotting/grid.c b/src/frontend/plotting/grid.c index 7a5c41e74..c7f1bacbf 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) - 1, "%.*f", digits + 1, m * mag / 100.0); + snprintf(buf, sizeof(buf), "%.*f", digits + 1, m * mag / 100.0); if (axis == x_axis) DevDrawText(buf, graph->viewportxoff + i - diff --git a/src/include/ngspice/graph.h b/src/include/ngspice/graph.h index b69634f17..02cdb0e0d 100644 --- a/src/include/ngspice/graph.h +++ b/src/include/ngspice/graph.h @@ -17,7 +17,7 @@ Author: 1988 Jeffrey M. Hsu struct _keyed; -#define GRAPH_UNITS_LENGTH 21 +#define GRAPH_UNITS_LENGTH 20 /* Device-independent data structure for plots. */ diff --git a/src/include/ngspice/ngspice.h b/src/include/ngspice/ngspice.h index c9f0ba291..69cce020b 100644 --- a/src/include/ngspice/ngspice.h +++ b/src/include/ngspice/ngspice.h @@ -190,7 +190,6 @@ extern double x_atanh(double); #define write _write #define strcasecmp _stricmp #define strncasecmp _strnicmp -#define snprintf _snprintf #define isatty _isatty #define inline __inline #define popen _popen