Remove another potential crash if buggy user input
This commit is contained in:
parent
c69018fe82
commit
732c12c93f
|
|
@ -691,7 +691,10 @@ measure_at(
|
||||||
value = d->v_realdata[i];
|
value = d->v_realdata[i];
|
||||||
// fprintf(cp_err, "Warning: 'meas ac' input vector is real!\n");
|
// fprintf(cp_err, "Warning: 'meas ac' input vector is real!\n");
|
||||||
}
|
}
|
||||||
|
if (dScale->v_compdata)
|
||||||
svalue = dScale->v_compdata[i].cx_real;
|
svalue = dScale->v_compdata[i].cx_real;
|
||||||
|
else
|
||||||
|
svalue = dScale->v_realdata[i]; //prevent crash in case if buggy input
|
||||||
} else if (sp_check) {
|
} else if (sp_check) {
|
||||||
if (d->v_compdata)
|
if (d->v_compdata)
|
||||||
value = get_value(meas, d, i); //d->v_compdata[i].cx_real;
|
value = get_value(meas, d, i); //d->v_compdata[i].cx_real;
|
||||||
|
|
@ -804,7 +807,7 @@ measure_minMaxAvg(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dScale->v_realdata == NULL && dScale->v_compdata == NULL) {
|
if (dScale->v_realdata == NULL && dScale->v_compdata == NULL) {
|
||||||
fprintf(cp_err, "Error: scale vector time, frequency or v-sweep has no data.\n");
|
fprintf(cp_err, "Error: scale vector time, frequency or ?-sweep has no data.\n");
|
||||||
return MEASUREMENT_FAILURE;
|
return MEASUREMENT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue