From ce69e8d70c045ea6556ad34385199fe1549e5a3f Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 21 Jul 2020 10:42:08 +0200 Subject: [PATCH] Don't send the empty line to create_circbyline(), it is not used anymore and may cause a crash --- src/sharedspice.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sharedspice.c b/src/sharedspice.c index e7eacaca9..1e189dea9 100644 --- a/src/sharedspice.c +++ b/src/sharedspice.c @@ -980,6 +980,9 @@ int ngSpice_Circ(char** circa){ while (circa[entries]) { entries++; } + entries--; /* don't send the empty line */ + if (ft_ngdebug) + fprintf(stdout, "\nngspiceCirc: received netlist array with %d entries\n", entries); /* create a local copy (to be freed in inpcom.c) */ for (i = 0; i < entries; i++) { newline = copy(circa[i]);