From b0da1f2a0f1809827a50a15d39c47a299a486fa0 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Wed, 5 Jul 2017 23:05:50 +0200 Subject: [PATCH] com_measure2.c, write a fft vector (sp plot) with complex data and real frequency to file and load it again, frequency now has become a complex number as well. This was not recognized, thus ngspice crashed (see https://sourceforge.net/p/ngspice/discussion/127605/thread/8cccd69c/ by Michal Janik - 2014-11-04 --- src/frontend/com_measure2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/com_measure2.c b/src/frontend/com_measure2.c index f2537582f..958a9c1b8 100644 --- a/src/frontend/com_measure2.c +++ b/src/frontend/com_measure2.c @@ -758,7 +758,11 @@ measure_minMaxAvg( value = get_value(meas, d, i); //d->v_compdata[i].cx_real; else value = d->v_realdata[i]; - svalue = dScale->v_realdata[i]; + if (dScale->v_realdata) + svalue = dScale->v_realdata[i]; + else + /* may happen if you write an sp vector and load it again */ + svalue = dScale->v_compdata[i].cx_real; } else { value = d->v_realdata[i]; svalue = dScale->v_realdata[i];