1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix uninitialized value

This commit is contained in:
Steffen Vogel 2017-03-12 23:20:15 -03:00
parent 83dfb31dc2
commit 339e45b205

View file

@ -67,7 +67,7 @@ static int hook_shift(struct hook *h, int when, struct hook_info *k)
case HOOK_READ:
for (int i = 0; i < k->cnt; i++) {
struct timespec *ts;
struct timespec *ts = NULL;
switch (private->mode) {
case TS_ORIGIN: ts = &k->smps[i]->ts.origin; break;
@ -75,7 +75,8 @@ static int hook_shift(struct hook *h, int when, struct hook_info *k)
case TS_SENT: ts = &k->smps[i]->ts.sent; break;
}
*ts = time_add(ts, &private->offset);
if (ts)
*ts = time_add(ts, &private->offset);
}
return k->cnt;