avoid segfault when printing aout a nonexistant `ReferenceValue' (pzan)

This commit is contained in:
rlar 2011-08-21 17:33:48 +00:00
parent 4cbfbad8b5
commit 146069952d
2 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2011-08-21 Robert Larice
* src/frontend/outitf.c :
avoid segfault when printing aout a nonexistant `ReferenceValue' (pzan)
2011-08-21 Holger Vogt
* fftext.h, fftext.c, fftlib.c, fftlib.h: type long to int
(patch by Robert)

View File

@ -494,7 +494,7 @@ OUTpData(void *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
/* we've already printed reference vec first */
if (run->data[i].outIndex == -1) continue;
#ifdef TCL_MODULE
blt_add(i,refValue->rValue);
blt_add(i, refValue ? refValue->rValue : NAN);
#endif
if (run->data[i].regular) {
@ -564,10 +564,10 @@ OUTpData(void *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
if ((currclock-lastclock)>(0.25*CLOCKS_PER_SEC)) {
if (run->isComplex) {
fprintf(stderr, " Reference value : % 12.5e\r",
refValue->cValue.real);
refValue ? refValue->cValue.real : NAN);
} else {
fprintf(stderr, " Reference value : % 12.5e\r",
refValue->rValue);
refValue ? refValue->rValue : NAN);
}
lastclock = currclock;
}