[libdvdnav-devel] [PATCH 3/7] Use correct constant

Petri Hintukainen phintuka at gmail.com
Wed May 20 12:41:38 CEST 2015


TITLES_MAX was used as length of string "/video_ts".
There's no relation between these two constants.
---
 src/dvd_reader.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/dvd_reader.c b/src/dvd_reader.c
index 005d90b..d1b1c04 100644
--- a/src/dvd_reader.c
+++ b/src/dvd_reader.c
@@ -484,16 +484,16 @@ static dvd_reader_t *DVDOpenCommon( const char *ppath,
     }
 
 #if defined(_WIN32) || defined(__OS2__)
-    if(strlen(path_copy) > TITLES_MAX) {
-      if(!strcasecmp(&(path_copy[strlen( path_copy ) - TITLES_MAX]),
+    if( strlen( path_copy ) > 9 ) {
+      if( !strcasecmp( &(path_copy[ strlen( path_copy ) - 9 ]),
                        "\\video_ts"))
-        path_copy[strlen(path_copy) - (TITLES_MAX-1)] = '\0';
+        path_copy[ strlen( path_copy ) - (9-1) ] = '\0';
     }
 #endif
-    if( strlen( path_copy ) > TITLES_MAX ) {
-      if( !strcasecmp( &(path_copy[ strlen( path_copy ) - TITLES_MAX ]),
+    if( strlen( path_copy ) > 9 ) {
+      if( !strcasecmp( &(path_copy[ strlen( path_copy ) - 9 ]),
                        "/video_ts" ) ) {
-        path_copy[ strlen( path_copy ) - TITLES_MAX ] = '\0';
+        path_copy[ strlen( path_copy ) - 9 ] = '\0';
       }
     }
 
-- 
2.1.4



More information about the libdvdnav-devel mailing list