[vlc-devel] [PATCH] ccda: fix compiler warning

Tristan Matthews tmatth at videolan.org
Mon Apr 12 16:59:41 UTC 2021


On Mon, Apr 12, 2021 at 12:51 PM George Vaindirlis
<george.vdl1 at gmail.com> wrote:
>
> fix warning: ā€˜%uā€™ directive output may be truncated writing between 1 and 10 bytes into a region of size 5 [-Wformat-truncation=]
> (Please reject the previous patch from me with the same description, it has a typo in the code)
>
> ---
>  modules/access/cdda.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/access/cdda.c b/modules/access/cdda.c
> index 9260b833ed..42ec944d12 100644
> --- a/modules/access/cdda.c
> +++ b/modules/access/cdda.c
> @@ -635,7 +635,7 @@ static void AccessGetMeta(stream_t *access, vlc_meta_t *meta)
>              vlc_meta_SetGenre(meta, str);
>
>          const unsigned year = cddb_disc_get_year(sys->cddb);
> -        if (year != 0)
> +        if (year != 0 && year < 10000)
>          {
>              char yearbuf[5];
>
> --
> 2.30.2
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

Should the same check be done here?
https://code.videolan.org/videolan/vlc/-/blob/master/modules/access/cdda.c#L829

Best,
Tristan


More information about the vlc-devel mailing list