[MPlayer-cvslog] r23727 - trunk/libdvdcss/libdvdcss.c

Diego Biurrun diego at biurrun.de
Fri Jul 13 18:49:31 CEST 2007


> New Revision: 23727
> 
> Log:
> Fix CSS format strings, they could print more than two digits for
> 
> Modified:
>    trunk/libdvdcss/libdvdcss.c
> 
> --- trunk/libdvdcss/libdvdcss.c	(original)
> +++ trunk/libdvdcss/libdvdcss.c	Sat Jul  7 00:07:35 2007
> @@ -472,7 +472,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( 
>              {
>                  char psz_tmp[16 + 1];
>                  sprintf( psz_tmp,
> -                         "%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
> +                         "%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"",
>                           psz_serial[0], psz_serial[1], psz_serial[2],
>                           psz_serial[3], psz_serial[4], psz_serial[5],
>                           psz_serial[6], psz_serial[7] );
> @@ -488,7 +488,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( 
>               psz_key[0] = '-';
>               for( i = 0; i < KEY_SIZE; i++ )
>               {
> -                 sprintf( &psz_key[1+i*2], "%.2x", dvdcss->css.p_disc_key[i] );
> +                 sprintf( &psz_key[1+i*2], "%.2"PRIx8, dvdcss->css.p_disc_key[i] );
>               }
>               psz_key[1 + KEY_SIZE * 2] = '\0';
>          }

Is this fit for upstream?

PRIx format specifiers are not used elsewhere in libdvdcss.  Are they
available everywhere?

Diego



More information about the MPlayer-cvslog mailing list