Some fix to sicshipadaba to prevent problems when trying to format a NULL node

Protected the nagging messages from scans/etc from missing data
This commit is contained in:
2017-03-15 16:45:52 +01:00
parent e8ae653095
commit e94e80264d
2 changed files with 10 additions and 6 deletions

View File

@@ -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");