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

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Thu May 21 01:39:27 CEST 2015


On Wed, 20 May 2015 13:41:38 +0300, Petri Hintukainen wrote:

>  #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';
                                            ^
>        }
>      }
>  

Why is one of these “9-1” and the other “9”? Both strings are the same
length.


More information about the libdvdnav-devel mailing list