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

Diego Biurrun <[email protected]>
Newsgroups gmane.comp.video.videolan.libdvdcss,gmane.comp.video.videolan.libdvdcss.devel
Message-ID <[email protected]>
---
 src/libdvdcss.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 0a3a12a..839dcb0 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -375,8 +375,8 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const 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" );
-- 
1.9.1

_______________________________________________
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.