diff --git a/sicshipadaba.c b/sicshipadaba.c index 3e7df068..fa3e1f8c 100644 --- a/sicshipadaba.c +++ b/sicshipadaba.c @@ -2065,7 +2065,7 @@ pDynString formatValue(hdbValue v, pHdb node) DynStringCopy(result, number); break; case HIPFLOAT: - if (GetHdbProperty(node, "fmt", format, sizeof format - 1)) { + if (node != NULL && GetHdbProperty(node, "fmt", format, sizeof format - 1)) { snprintf(number, 30, format, v.v.doubleValue); } else { snprintf(number, 30, "%.6g", v.v.doubleValue); @@ -2084,7 +2084,7 @@ pDynString formatValue(hdbValue v, pHdb node) break; case HIPFLOATAR: case HIPFLOATVARAR: - if (GetHdbProperty(node, "fmt", format + 1, sizeof format - 2)) { + if (node != NULL && GetHdbProperty(node, "fmt", format + 1, sizeof format - 2)) { format[0] = ' '; } else { strcpy(format, " %.6g"); diff --git a/sicsutil.c b/sicsutil.c index dea1e3a7..783c77ef 100644 --- a/sicsutil.c +++ b/sicsutil.c @@ -142,12 +142,13 @@ int CheckSum(SConnection * pCon, SicsInterp * pSics, void *pData, return 0; } /*-----------------------------------------------------------------------------*/ -void LogUserInfo(void *data) +void LogUserInfo(void *pData) { hdbValue user, proposal; - SConnection *pCon = (SConnection *)data; + SConnection *pCon = (SConnection *)pData; + pDynString data; - if(data == NULL){ + if(pData == NULL){ return; } user = MakeHdbText(strdup("Martina Notconfigured")); @@ -155,7 +156,10 @@ void LogUserInfo(void *data) sget("user",&user); sget("proposalid",&proposal); - SCPrintf(pCon,eLog,"WARNING: Saving data for %s, proposal %s", user.v.text, proposal.v.text); + data = formatValue(proposal,NULL); + SCPrintf(pCon,eLog,"WARNING: Saving data for %s, proposal %s", user.v.text, + GetCharArray(data)); + DeleteDynString(data); ReleaseHdbValue(&user); ReleaseHdbValue(&proposal);