[libdvdcss-devel] [PATCH] Check the return values of write() calls.
Ivan Kalvachev
ikalvachev at gmail.com
Tue Mar 12 23:14:04 CET 2013
On 3/12/13, Diego Biurrun <diego at biurrun.de> wrote:
> Fixes the following two warnings:
> src/libdvdcss.c:380:18: warning: ignoring return value of ‘write’, declared
> with attribute warn_unused_result [-Wunused-result]
> src/css.c:275:18: warning: ignoring return value of ‘write’, declared with
> attribute warn_unused_result [-Wunused-result]
> ---
>
> Not leaking fds anymore; just print a warning if writing the cache fails.
>
> src/css.c | 9 +++++++--
> src/libdvdcss.c | 7 ++++++-
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/src/css.c b/src/css.c
> index 935b7b2..fb45927 100644
> --- a/src/css.c
> +++ b/src/css.c
> @@ -266,13 +266,18 @@ int _dvdcss_title ( dvdcss_t dvdcss, int i_block )
> i_fd = open( dvdcss->psz_cachefile, O_RDWR|O_CREAT, 0644 );
> if( i_fd >= 0 )
> {
> - char psz_key[KEY_SIZE * 3 + 2];
> + ssize_t len = KEY_SIZE * 3 + 2;
> + char psz_key[len];
I think Mans got rid of all VLA in LibAV recently, strange to see you
adding them to dvdcss.
More information about the libdvdcss-devel
mailing list