[libdvdnav-devel] src/dvd_input.c: Reduce the scope of 'ret' in file_read

Andrew Clayton git at videolan.org
Fri Oct 24 16:29:23 CEST 2014


libdvdread | branch: master | Andrew Clayton <andrew at digital-domain.net> | Fri Oct 24 15:21:29 2014 +0100| [c6bd4ebab126e5ac0fc027d3d16d0acb1c784d88] | committer: Jean-Baptiste Kempf

src/dvd_input.c: Reduce the scope of 'ret' in file_read

The ret variable is only used wihin the while loop.

Signed-off-by: Andrew Clayton <andrew at digital-domain.net>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/libdvdread.git/?a=commit;h=c6bd4ebab126e5ac0fc027d3d16d0acb1c784d88
---

 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



More information about the libdvdnav-devel mailing list