From a8eec8ee875fa0f68912d94a2df3e2cada2f52b7 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 30 Oct 2024 13:36:02 +0100 Subject: [PATCH] Bail out when the number of s parameter ports is less than 2. --- src/spicelib/analysis/span.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/spicelib/analysis/span.c b/src/spicelib/analysis/span.c index 30c77370d..fcdabd28a 100644 --- a/src/spicelib/analysis/span.c +++ b/src/spicelib/analysis/span.c @@ -363,14 +363,17 @@ SPan(CKTcircuit* ckt, int restart) data = TMALLOC(Ndata, 1); } - if (ckt->CKTportCount == 0) { - fprintf(stderr, "No RF Port is present\n"); - return (E_PARMVAL); + fprintf(stderr, "\nError: No RF Port is present, cannot run sp analysis\n"); + controlled_exit(EXIT_BAD); } - + if (ckt->CKTportCount == 1) + { + fprintf(stderr, "\nError: Only one RF Port is found, we need at least two!\n"); + controlled_exit(EXIT_BAD); + } #ifdef XSPICE /* gtri - add - wbk - 12/19/90 - Add IPC stuff and anal_init and anal_type */