From 39316ea3c6f1f856ab2afbee8862a64836504feb Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 26 Oct 2022 16:23:00 +0200 Subject: [PATCH] Function ngSpice_Circ() may send empty lines to shared ngspice. Skip these lines while processing the netlist array. --- src/frontend/inp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index ad7099ccd..e1735ac12 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -1878,8 +1878,12 @@ void create_circbyline(char *line, bool reset, bool lastline) circarray = TREALLOC(char *, circarray, n_elem_alloc); } - /* Remove any leading whitespace by shifting */ char *p_src = skip_ws(line); + /* return if line is empty */ + if (*p_src == '\0') + return; + + /* Remove any leading whitespace by shifting */ if (p_src != line) { char *p_dst = line; char ch_cur;