summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 932d2aa)
raw | patch | inline | side by side (parent: 932d2aa)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 30 Oct 2012 06:24:02 +0000 (07:24 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 30 Oct 2012 06:24:02 +0000 (07:24 +0100) |
src/rrtimeslice.c | patch | blob | history |
diff --git a/src/rrtimeslice.c b/src/rrtimeslice.c
index 325d736fe3e90bf35a72108a2ae8c80a1579ffd8..4f151d27b1b3f93b60164bc9759ddfb718396b46 100644 (file)
--- a/src/rrtimeslice.c
+++ b/src/rrtimeslice.c
{
rrtimeslice_t *tslice;
- Interval interval;
-
struct pg_tm tm;
fsec_t fsec = 0;
int tz = 0;
EncodeDateTime(&tm, fsec, &tz, &tz_str, DateStyle, buf_ts);
if (! rrtimeslice_get_spec(tslice->tsid, &len, &num)) {
+ Interval interval;
+
memset(&interval, 0, sizeof(interval));
interval.time = len * USECS_PER_SEC;
fsec = 0;
ereport(ERROR, (
errmsg("could not convert interval to tm")
));
+
+ EncodeInterval(&tm, fsec, IntervalStyle, buf_l);
}
else {
strncpy(buf_l, "ERR", sizeof(buf_l));
buf_l[sizeof(buf_l) - 1] = '\0';
}
- EncodeInterval(&tm, fsec, IntervalStyle, buf_l);
-
snprintf(ts_str, sizeof(ts_str), "%s -%s (#%i)",
buf_ts, buf_l, tslice->seq);