[Mesa-dev] [PATCH 2/5] egl/android: use strcmp with drmVersion::name
Tomasz Figa
tfiga at chromium.org
Mon Aug 13 16:18:56 UTC 2018
On Tue, Aug 14, 2018 at 12:47 AM Emil Velikov <emil.l.velikov at gmail.com> wrote:
>
> On 13 August 2018 at 16:21, Tomasz Figa <tfiga at chromium.org> wrote:
> > On Mon, Aug 13, 2018 at 11:48 PM Emil Velikov <emil.l.velikov at gmail.com> wrote:
> >>
> >> From: Emil Velikov <emil.velikov at collabora.com>
> >>
> >> The name string is guaranteed to be NULL terminated. Drop the explicit
> >> length check that comes with strncmp().
> >
> > Is there anything wrong with that length check? I feel like it's a
> > good practice to keep it anyway.
> >
> Consider the a long DRM driver name, that goes over PROPERTY_VALUE_MAX.
> One could replace it with min(PROP.., version::name_len), although it
> does seem over pedantic.
>
> I'm yet to see a single instance that does strncmp for the name.
Fair enough. Sorry for the noise.
Best regards,
Tomasz
More information about the mesa-dev
mailing list