This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: Fixes for string functions
- From: Eric McDonald <emcdonal at cps dot cmich dot edu>
- To: Erik Sigra <sigra at home dot se>
- Cc: xconq7 at sources dot redhat dot com
- Date: Sun, 10 Aug 2003 17:37:33 -0400 (EDT)
- Subject: Re: Fixes for string functions
- References: <200308102208.29413.sigra@home.se>
On Sun, 10 Aug 2003, Erik Sigra wrote:
> Here are some fixes for string functions that seem important:
Hi Erik,
I agree with your fixes in principle.
However, I am not sure whether vsnprintf(3) enjoys universal support on
the various target platforms. Unlike vsprintf(3), vsnprintf does not
conform to the ANSI C (C89) standard; it was introduced from the BSD
family, and not all SysV platforms may support it (not to mention non-Unix
platforms). I did a grep of the C source in the kernel subdirectory, and
did not turn up any other places where this function is used. But maybe I
am just nitpicking....
Also, in the case where you are dealing with the 300 byte line buffer,
maybe we should either redefine it as being BUFSIZE (255 bytes) in length,
or define a LINEBUFSIZE macro, so that we are not hardcoding a literal all
over the place.
And even with this fix, we are not entirely out of danger, because the
buffer that strcat appends the line buffer to may not be large enough.
Regards,
Eric