diff --git a/logger.c b/logger.c index e175f8cd..4353bb83 100644 --- a/logger.c +++ b/logger.c @@ -299,7 +299,7 @@ int LoggerWrite(Logger * log, time_t now, int period, char *value) if (now > omitCheck + 5) { /* check for omitted values only every 5 seconds */ for (p = list; p != NULL; p = p->next) { if (p->omitTime > 0 && now > p->omitTime + p->period) { - snprintf(buf, sizeof buf, "%g", p->omitValue); + snprintf(buf, sizeof buf, "%.7g", p->omitValue); LoggerWrite0(p, p->omitTime, p->period, buf); p->omitTime = 0; } diff --git a/logreader.c b/logreader.c index 79cf8809..dc68352f 100644 --- a/logreader.c +++ b/logreader.c @@ -69,7 +69,7 @@ static void OutFloat(Compressor * c, Point p) } else { if (c->omitEqual && c->written.y == p.y) return; - snprintf(c->buf, sizeof(c->buf), "%g", p.y); + snprintf(c->buf, sizeof(c->buf), "%.7g", p.y); value = c->buf; } SCPrintf(c->pCon, eWarning, "%ld %s", (long) (p.t - c->written.t), @@ -141,7 +141,7 @@ static void PutFinish(Compressor * c, time_t now) if (c->type == NUMERIC) { if (now > c->last.t + c->period) { /* copy last value to the actual time */ if (c->last.y != LOGGER_NAN) { - snprintf(value, sizeof value, "%g", c->last.y); + snprintf(value, sizeof value, "%.7g", c->last.y); PutValue(c, now, value); } if (c->best.t > c->written.t) { diff --git a/sicscron.c b/sicscron.c index 06feb9d3..0be410c7 100644 --- a/sicscron.c +++ b/sicscron.c @@ -74,8 +74,15 @@ static int CronTask(void *pData) StatisticsEnd(old); MacroPop(); if (iRet != TCL_OK) { + if (strcmp(pTcl->result, "stop") == 0) { + SCPrintf(self->pCon, eLogError, "sicscron script '%s' stopped", + self->pCommand); + self->iEnd = 0; + return 0; + } SCPrintf(self->pCon, eLogError, - "ERROR in sicscron script: %s", pTcl->result); + "ERROR in sicscron script '%s':", self->pCommand); + SCPrintf(self->pCon, eLogError, "ERROR: %s", pTcl->result); } if (self->iEnd == 2) { /* dolater command */ self->iEnd = 0;