From b2113915a2245bc8ee164571f3e34a3ecd4b08bc Mon Sep 17 00:00:00 2001 From: "Long.inus" Date: Mon, 16 Dec 2013 04:26:03 +0900 Subject: [PATCH] tunerec: fix mrb_put remaining bytes calculation, include ctype.h --- tunerec/tunerec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tunerec/tunerec.c b/tunerec/tunerec.c index d1ea2af..a30bfe9 100755 --- a/tunerec/tunerec.c +++ b/tunerec/tunerec.c @@ -15,6 +15,7 @@ #include #include #include +#include #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #ifndef DTV_STREAM_ID @@ -95,7 +96,7 @@ bool mrb_get(mrb* rb, char *target, size_t size) { // RingBuffer underflow. return false; } - if ( rb->rb_rt + size <= rb->rb_wt ) { + if ( rb->rb_rt + size <= RING_BUFFER_SIZE ) { // read bytes + newly taken bytes <= buffer max size memcpy(target, rb->rb_ptr + rb->rb_rt, size); rb->rb_rt = rb->rb_rt + size; -- 2.11.0