ref: 1ecbd379c4f9c768553bfc13ee0c9985fcef7b47
parent: 3c3fb43d6e7b925339b8172163ce4a0d4fd430da
author: Diego Biurrun <diego@biurrun.de>
date: Tue Oct 28 15:59:03 EDT 2014
libdvdcss: Avoid a cast when comparing the return values of write() and strlen()
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -375,8 +375,8 @@
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" );