[vlc-devel] [PATCH] opengl: vaapi: silence strncpy warning

Alexandre Janniaux ajanni at videolabs.io
Tue Sep 24 17:45:35 CEST 2019


Hi,

That was not the target of the patch so I completely oversighed it
but indeed. I've sent a better version.

Regards,
--
Alexandre Janniaux
Videolabs

On Tue, Sep 24, 2019 at 05:33:03PM +0200, Steve Lhomme wrote:
> sizeof() or ARRAY_SIZE() would be cleaner IMO.
>
>
> On 2019-09-03 15:35, Alexandre Janniaux wrote:
> > Silence -Wstringop-truncation warning.
> > ---
> >   modules/video_output/opengl/converter_vaapi.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/modules/video_output/opengl/converter_vaapi.c b/modules/video_output/opengl/converter_vaapi.c
> > index 504969f4da..038d98bc08 100644
> > --- a/modules/video_output/opengl/converter_vaapi.c
> > +++ b/modules/video_output/opengl/converter_vaapi.c
> > @@ -310,7 +310,7 @@ tc_va_check_interop_blacklist(opengl_tex_converter_t *tc, VADisplay *vadpy)
> >       };
> >
> >       char vendor_prefix[BL_SIZE_MAX];
> > -    strncpy(vendor_prefix, vendor, BL_SIZE_MAX);
> > +    strncpy(vendor_prefix, vendor, BL_SIZE_MAX-1);
> >       vendor_prefix[BL_SIZE_MAX - 1] = '\0';
> >
> >       const char *found = bsearch(vendor_prefix, blacklist_prefix,
> > --
> > 2.23.0
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> >
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list