[libdvdcss-devel] cache: open the binary cache file as binary.

Diego Elio Pettenò git at videolan.org
Wed Feb 27 08:09:27 CET 2013


libdvdcss | branch: xdgcache | Diego Elio Pettenò <flameeyes at flameeyes.eu> | Wed Feb 27 07:54:31 2013 +0100| [6c58645b56b4304bdd046d41e166c5babd28f42b] | committer: Diego Elio Pettenò

cache: open the binary cache file as binary.

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

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

diff --git a/src/css.c b/src/css.c
index 64a966a..5a73d63 100644
--- a/src/css.c
+++ b/src/css.c
@@ -212,7 +212,7 @@ int _dvdcss_title ( dvdcss_t dvdcss, int i_block )
     {
         /* XXX: be careful, we use sprintf and not snprintf */
         sprintf( dvdcss->psz_block, "%.10x.bin", i_block );
-        i_fd = open( dvdcss->psz_cachefile, O_RDONLY );
+        i_fd = open( dvdcss->psz_cachefile, O_RDONLY|O_BINARY );
         b_cache = 1;
 
         if( i_fd >= 0 )
@@ -250,7 +250,7 @@ int _dvdcss_title ( dvdcss_t dvdcss, int i_block )
     /* Key is valid, we store it on disk. */
     if( dvdcss->psz_cachefile[0] && b_cache )
     {
-        i_fd = open( dvdcss->psz_cachefile, O_RDWR|O_CREAT, 0644 );
+        i_fd = open( dvdcss->psz_cachefile, O_RDWR|O_CREAT|O_BINARY, 0644 );
         if( i_fd >= 0 )
         {
             write( i_fd, p_title_key, KEY_SIZE );



More information about the libdvdcss-devel mailing list