From 6ab91f2e9f74553877c1c8295ec9cf9981ec2b38 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 30 Jun 2011 16:29:42 +0000 Subject: [PATCH] com_measure2.c, uninitialized variable warning --- ChangeLog | 4 ++++ src/frontend/com_measure2.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 77fa5e429..70c40ad90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-06-30 Robert Larice + * src/frontend/com_measure2.c : + com_measure2.c, uninitialized variable warning + 2011-06-30 Robert Larice * src/spicelib/devices/bsim4/b4noi.c , * src/spicelib/devices/hisim2/hsm2noi.c , diff --git a/src/frontend/com_measure2.c b/src/frontend/com_measure2.c index 3045b34c2..d7ef5fdc5 100644 --- a/src/frontend/com_measure2.c +++ b/src/frontend/com_measure2.c @@ -383,10 +383,14 @@ static void com_measure_when( struct dvec *d, *d2, *dScale; d = vec_get(meas->m_vec); + if (meas->m_vec2) { d2 = vec_get(meas->m_vec2); has_d2 = TRUE; + } else { + d2 = NULL; } + dScale = plot_cur->pl_scale; if (d == NULL) { @@ -394,7 +398,7 @@ static void com_measure_when( return; } - if ((has_d2) && (d == NULL)) { + if (has_d2 && (d2 == NULL)) { fprintf(cp_err, "Error: no such vector as %s.\n", meas->m_vec2); return; } @@ -460,7 +464,10 @@ static void com_measure_when( else { value2 = d2->v_realdata[i]; } + } else { + value2 = NAN; } + /* 'dc' is special: it may start at an arbitrary scale value. Use m_td to store this value, a delay TD does not make sense */ if ((dc_check) && (i==0))