[pacman-dev] [PATCH] package.c, fix incorrect buffersize

Rikard Falkeborn rikard.falkeborn at gmail.com
Sun Nov 1 09:05:30 UTC 2015


Den 1 nov 2015 09:55 skrev "Rikard Falkeborn" <rikard.falkeborn at gmail.com>:
>
>
> Den 1 nov 2015 09:36 skrev "Pierre Neidhardt" <ambrevar at gmail.com>:
> >
> > There is a much simpler fix:
> >
> > > -     static const wchar_t *title_suffix = L" :";
> > > -     static const wchar_t title_suffix[] = L" :";
> >
> > I'll commit the patch right row.
> >
> > --
> > Pierre Neidhardt
> >
> > To communicate is the beginning of understanding.
> >                 -- AT&T
>
> That's simpler. :)
>
> Can you check if clang is happy with the fix? The reason I found it in
the first place was a clang warning. I don't have a computer nearby to test
it on myself at the moment.
>
> /Rikard

Simpler but not correct I think. We don't want the size in bytes, we want
the number of elements. So making it an array and using ARRAYSIZE would do
the trick. Provided clang doesn't warn...  :)

Rikard


More information about the pacman-dev mailing list