[libdvdcss-devel] libdvdcss: Avoid a cast when comparing the return values of write() and strlen()

[email protected] (Diego Biurrun)
Newsgroups gmane.comp.video.videolan.libdvdcss,gmane.comp.video.videolan.libdvdcss.devel
Message-ID <[email protected]>
libdvdcss | branch: master | Diego Biurrun <[email protected]> | Tue Oct 28 19:59:03 2014 +0100| [1ecbd379c4f9c768553bfc13ee0c9985fcef7b47] | committer: Diego Biurrun

libdvdcss: Avoid a cast when comparing the return values of write() and strlen()

> http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=1ecbd379c4f9c768553bfc13ee0c9985fcef7b47
---

 src/libdvdcss.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index a48a6ff..a602050 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -375,8 +375,8 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target )
         i_fd = open( psz_tagfile, O_RDWR|O_CREAT, 0644 );
         if( i_fd >= 0 )
         {
-            size_t len = strlen(psz_tag);
-            if( write( i_fd, psz_tag, len ) < (long)len )
+            ssize_t len = strlen(psz_tag);
+            if( write( i_fd, psz_tag, len ) < len )
             {
                 print_error( dvdcss,
                              "Error writing cache directory tag, continuing..\n" );

_______________________________________________
libdvdcss-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libdvdcss-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.