Discussion:
[libdvdcss-devel] [PATCH] fix sprintf format strings
Diego Biurrun
2008-08-21 20:53:55 UTC
Permalink
Here is a patch that we have been using in MPlayer for a while. Some
sprintf calls in libdvdcss.c are not using the correct format string for
the uint8_t type. The Subversion log message is

Log:
Fix CSS format strings, they could print more than two digits for
"negative" numbers.

I have extended the patch to use inttypes.h instead of stdint.h in
common.h, which is needed for the PRIx8 conversion specifier. This
might need some additional changes in the autoconf build system.

Diego
Sam Hocevar
2008-08-29 19:42:24 UTC
Permalink
Post by Diego Biurrun
Here is a patch that we have been using in MPlayer for a while. Some
sprintf calls in libdvdcss.c are not using the correct format string for
the uint8_t type. The Subversion log message is
Fix CSS format strings, they could print more than two digits for
"negative" numbers.
As discussed on IRC, a fix for this issue was actually already in
trunk. I do not feel the need to switch to PRIx8 conversions because
arguments smaller than int will be promoted with the expected sign
extension anyway (C standard 6.5.2.3p7 for variadic function rules,
6.3.1.1 for integer promotion).

Cheers,
--
Sam.
Loading...