Fixed Win32 crash resulting from strtoll() macro.

This patch addresses a crash caused by the Win32 implementation
of the strtoll() macro in config.h, which is generated from
config.h.in.  This patch fixes config.h.in.  The change will
affect files using strtoll() on Win32 builds with an "old enough"
Microsoft Visual C/C++ compiler.

The addition operator ("+") has higher precedence than the conditional
operator ("a ? b : c").  The portion of the Win32 implementation of the
strtoll() macro in question is below:
  *(e) = (char*)(p) + ((b) == 10) ? strspn((p), "0123456789") : 0
The compiler will evaluate the expression like this:
  *(e) = ( (char*)(p) + ((b) == 10) ) ? strspn((p), "0123456789") : 0
The code was meant to evaluate like this:
  *(e) = (char*)(p) + ( ((b) == 10) ? strspn((p), "0123456789") : 0 )
The code is effectively pointing "e" to the first nondigit character
starting at where "p" points to.  Because of the precendence rules,
the invocation of strtoll() in set_seed() in file flood.c effectively
compiled to this code:
  *(e) = strspn((p), "0123456789")
which yields an invalid address.

The above assignment triggers the compiler warning below.
  flood.c(105) : warning C4047: '=' : 'char *' differs in levels of
  indirection from 'const unsigned int '
The build produces seven occurrences of this warning.  After the
code fix, those seven occurrences disappear.

When applying this fix, you should rebuild all files to ensure they
re-evaluate the corrected strtoll() macro from a newly generated
config.h file.

Reviewed by: Will Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/test/trunk/flood@98526 13f79535-47bb-0310-9956-ffa450edef68
2 files changed