]> sigrok.org Git - libsigrok.git/blobdiff - src/sw_limits.c
sw_limits: start msec timeout period only after start() call
[libsigrok.git] / src / sw_limits.c
index 37c28667987df4f643e584466ae0b3e3eb15453f..9d80c06bf1b3dcd8bc451ccb548a8e5b53df4684 100644 (file)
@@ -43,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));
 }
 
 /**
@@ -153,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 &&