From 7d986b1a9fdb5c7bb0bd815f7f66a303d3584cce Mon Sep 17 00:00:00 2001 From: Mark Koennecke Date: Thu, 22 May 2014 10:45:48 +0200 Subject: [PATCH] - Fixed a bug in poldifold which caused a crash whne the HM data was not initialized - The astrium chopper controller requires floats with a . and retuns them with a , . Accomodated for this quirk --- astriumnet.c | 2 +- poldifold.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/astriumnet.c b/astriumnet.c index 2b86d5f..6aac4e9 100644 --- a/astriumnet.c +++ b/astriumnet.c @@ -93,7 +93,7 @@ static void encodeXML(Ascon *a) if(equal != NULL){ *equal = '\0'; equal++; - ptToKomma(equal); + /* ptToKomma(equal);*/ mxmlElementSetAttr(param,token,equal); } else { mxmlElementSetAttr(param,token,NULL); diff --git a/poldifold.c b/poldifold.c index 7acf1b3..255ff4b 100644 --- a/poldifold.c +++ b/poldifold.c @@ -61,6 +61,14 @@ static int PoldiFold (pSConnection pCon, pSicsInterp pInter, void nDet = dim->value.v.intArray[0]; nSourceTof = dim->value.v.intArray[1]; + /* + check for badly initailized data array + */ + if(source->value.arrayLength < nDet*nSourceTof){ + SCWrite(pCon,"ERROR: hm data not initialised to correct length!", eError); + return 0; + } + /* ensure enough space to write */