Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Nov 2015 19:30:59 +0300
From:      Sergey Kandaurov <pluknet@gmail.com>
To:        Joerg Sonnenberger <joerg@britannica.bec.de>
Cc:        svn-src-all@freebsd.org
Subject:   Re: svn commit: r290499 - head/usr.bin/localedef
Message-ID:  <CAE-mSOKF_nUMTEdM-W7GvKUQcTCCuvVBzSEKAgWbx6_pLkc%2BBw@mail.gmail.com>
In-Reply-To: <20151107162617.GA21271@britannica.bec.de>
References:  <201511071622.tA7GMTDN099727@repo.freebsd.org> <20151107162617.GA21271@britannica.bec.de>

index | next in thread | previous in thread | raw e-mail

7 нояб. 2015 г. 7:26 PM пользователь "Joerg Sonnenberger" <
joerg@britannica.bec.de> написал:
>
> On Sat, Nov 07, 2015 at 04:22:29PM +0000, Baptiste Daroussin wrote:
> > Author: bapt
> > Date: Sat Nov  7 16:22:29 2015
> > New Revision: 290499
> > URL: https://svnweb.freebsd.org/changeset/base/290499
> >
> > Log:
> >   Workaround an issue on i386 to unbreak the build until the real issue
is tracked
> >   down
> >
> > Modified:
> >   head/usr.bin/localedef/collate.c
> >
> > Modified: head/usr.bin/localedef/collate.c
> >
==============================================================================
> > --- head/usr.bin/localedef/collate.c  Sat Nov  7 15:03:45 2015
(r290498)
> > +++ head/usr.bin/localedef/collate.c  Sat Nov  7 16:22:29 2015
(r290499)
> > @@ -1255,7 +1255,8 @@ dump_collate(void)
> >        * Large (> UCHAR_MAX) character priorities
> >        */
> >       RB_NUMNODES(collchar_t, collchars, &collchars, n);
> > -     large = calloc(sizeof (collate_large_t) * n, 1);
> > +     large = malloc(sizeof (collate_large_t) * n);
> > +     memset(large, 0, sizeof (collate_large_t) * n);
> >       if (large == NULL) {
> >               fprintf(stderr, "out of memory");
> >               return;
>
> Why was this not calloc(sizeof(), n) in first place?!
>

And memset should probably be moved after the check against null.


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE-mSOKF_nUMTEdM-W7GvKUQcTCCuvVBzSEKAgWbx6_pLkc%2BBw>