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

Diego Biurrun diego at biurrun.de
Wed Oct 29 21:33:34 CET 2014


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



More information about the libdvdcss-devel mailing list