[libdvdcss-devel] [PATCH] Check the return values of write() calls.

Diego Elio Pettenò flameeyes at flameeyes.eu
Wed Mar 13 11:39:53 CET 2013


That is not a VLA: the len variable is all precalculated. You could
hint it better by declaring it a 'static const' .
Diego Elio Pettenò — Flameeyes
flameeyes at flameeyes.euhttp://blog.flameeyes.eu/


On Tue, Mar 12, 2013 at 11:14 PM, Ivan Kalvachev <ikalvachev at gmail.com> wrote:
> 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.
> _______________________________________________
> libdvdcss-devel mailing list
> libdvdcss-devel at videolan.org
> http://mailman.videolan.org/listinfo/libdvdcss-devel


More information about the libdvdcss-devel mailing list