X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fsw_limits.c;h=9d80c06bf1b3dcd8bc451ccb548a8e5b53df4684;hb=0dc27cd1dbc961366d14607526e54992078e9d5c;hp=6e1c4c141018392b6067f5d661f4fdd72adcdf6d;hpb=67785f2568f20de7350b09ff6049ecec225af498;p=libsigrok.git diff --git a/src/sw_limits.c b/src/sw_limits.c index 6e1c4c14..9d80c06b 100644 --- a/src/sw_limits.c +++ b/src/sw_limits.c @@ -20,7 +20,6 @@ /** * @file * Software limits helper functions - * @internal */ #include @@ -44,9 +43,7 @@ */ SR_PRIV void sr_sw_limits_init(struct sr_sw_limits *limits) { - limits->limit_samples = 0; - limits->limit_frames = 0; - limits->limit_msec = 0; + memset(limits, 0, sizeof(*limits)); } /** @@ -154,7 +151,7 @@ SR_PRIV gboolean sr_sw_limits_check(struct sr_sw_limits *limits) } } - if (limits->limit_msec) { + if (limits->limit_msec && limits->start_time) { guint64 now; now = g_get_monotonic_time(); if (now > limits->start_time &&