httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject Re: [PATCH] Win32 strftime
Date Sun, 01 Nov 1998 00:30:07 GMT
On Tue, 27 Oct 1998, Manoj Kasichainula wrote:

> The win32 strftime seems to be deficient. It doesn't provide certain
> %-expandos that other platforms do. So, Ken Parzygnat and I built a
> strftime-adapter that handles the extra expandos and passes the
> partially digested result to the real strftime. This allows things
> that depend on strftime, such as SSI, to have a consistent interface
> available. The patch is attached.

The use of malloc() isn't safe because we could timeout in the middle.
Likely?  No.  Possible?  Yes, and some freak could result in the Win32
strftime() blocking for some reason, etc.  I'm assuming the Win32 timeouts
do longjmp or something similar that jumps out of the current frame and to
wherever.  You can use alloca as an alternative if it works on Win32.

Other than that, looks ok.

Note that the assumption of a format string bigger than max --> a result
string bigger than max isn't valid.

eg. strftime(out, 6, "%%%%%%%%%%") is valid.  If you change 6 to 600 and
give 1200 '%'s instead, then it looks like your code will fail;
gracefully, but still a fail.  I wouldn't worry about that one though.

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message