[libbluray-devel] commit: libbluray_test: check fwrite() return value (hpi1 )

git at videolan.org git at videolan.org
Thu Oct 14 17:19:53 CEST 2010


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Oct 14 18:02:52 2010 +0300| [4a8998e0e2713a65dfb3915d5fc085f35cf40a3f] | committer: hpi1 

libbluray_test: check fwrite() return value

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=4a8998e0e2713a65dfb3915d5fc085f35cf40a3f
---

 src/examples/libbluray_test.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/examples/libbluray_test.c b/src/examples/libbluray_test.c
index 450f676..181f717 100644
--- a/src/examples/libbluray_test.c
+++ b/src/examples/libbluray_test.c
@@ -72,7 +72,8 @@ int main(int argc, char *argv[])
         while (1) {
             int len = bd_read(bd, buf, 6144);
             if (len <= 0) break;
-            fwrite(buf, len, 1, fd);
+            if (fwrite(buf, len, 1, fd) < 1)
+              break;
             if (!(ii % 1000)) {
                 DEBUG(DBG_BLURAY,
                       "%d\r", ii);



More information about the libbluray-devel mailing list