[libdvdnav-devel] [PATCH 1/7] src/dvd_input.c: Reduce the scope of 'ret' in file_read
Andrew Clayton
andrew at digital-domain.net
Fri Oct 24 16:21:29 CEST 2014
The ret variable is only used wihin the while loop.
Signed-off-by: Andrew Clayton <andrew at digital-domain.net>
---
src/dvd_input.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/dvd_input.c b/src/dvd_input.c
index 9e6a0de..3b7f679 100644
--- a/src/dvd_input.c
+++ b/src/dvd_input.c
@@ -218,13 +218,11 @@ static int file_title(dvd_input_t dev, int block)
static int file_read(dvd_input_t dev, void *buffer, int blocks, int flags)
{
size_t len;
- ssize_t ret;
len = (size_t)blocks * DVD_VIDEO_LB_LEN;
while(len > 0) {
-
- ret = read(dev->fd, buffer, len);
+ ssize_t ret = read(dev->fd, buffer, len);
if(ret < 0) {
/* One of the reads failed, too bad. We won't even bother
--
1.9.3
More information about the libdvdnav-devel
mailing list