You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@worldgate.com> on 1998/11/05 20:31:51 UTC

Re: cvs commit: apache-1.3/src/os/win32 os.h util_win32.c

On 5 Nov 1998 manoj@hyperreal.org wrote:

>   +            /* Handle "%%" to avoid dying on strftime(out, 600, 1200 "%"'s) */
>   +            case '%':
>   +                new_format[j++] = '%';
>   +                i += 2;
>   +                break;

That isn't going to work is it?

Since strftime needs %% to do %, we can't handle it since strftime will
still try.

I guess this same thing can happen when other single-digit (ie. 
non-0-padded) things are returned.  %w is the only one I can think of that
always returns a single digit, and the win32 strftime may not deal with
that one anyway.  I'm happy if we just live with the fact that it will
fail on certain boundry conditions.  They aren't as unlikely as it may
appear at first, since it is perfectly reasonable for something calling
strftime to know how big the result should be and allocate just enough for
it, but... not worth worrying about, especially since that doesn't (AFAIK)
happen in Apache.


Re: cvs commit: apache-1.3/src/os/win32 os.h util_win32.c

Posted by Manoj Kasichainula <ma...@io.com>.
On Thu, Nov 05, 1998 at 12:31:51PM -0700, Marc Slemko wrote:
> Since strftime needs %% to do %, we can't handle it since strftime will
> still try.

Oof. Yes. That's the whole point of %%, isn't it? I took it out again.

> I guess this same thing can happen when other single-digit (ie. 
> non-0-padded) things are returned.

Right. I was hoping to at least make this scenario more unlikely. If
it ever becomes an issue, I guess we can always write a full strftime.

-- 
Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/
"Show me an Ethernet collision and I'll show you a network that could
do with one user fewer." -- BOFH