xcalloc question

From: Adrian Chadd <adrian@dont-contact.us>
Date: Tue, 16 Oct 2001 09:40:32 -0600

Hi,

I'm currently doing a code warning sweep using FreeBSD's BDECFLAGS.
Its uhm, enlightening, like the Mipspro compiler is enlightening. :)

(FYI, here's BDECFLAGS:

# BDECFLAGS are a set of gcc warning settings that Bruce Evans has suggested
# for use in developing FreeBSD and testing changes. They can be used by
# putting "CFLAGS+=${BDECFLAGS}" in /etc/make.conf.
#
BDECFLAGS= -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
                -Wcast-qual -Wchar-subscripts -Wconversion -Winline \
                -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
                -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings

.. which, a lot of FreeBSD code generates warnings with. :-)

Ok, so here's my question: in access_log.c, there's this bit of code:

    buf = xcalloc((strlen(header) * 3) + 1, 1);

Now, it _looks_ like someone got the xcalloc arguments backwards,
right? Can anyone see any reason why this code should be allocating
RAM using the above arguments?

Adrian
Received on Tue Oct 16 2001 - 09:40:33 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:32 MST