apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Re: [PATCH] %lld support in apr_snprintf()
Date Thu, 04 Nov 2010 19:15:58 GMT
On 11/4/2010 2:46 PM, Sander Temme wrote:
> Folks, 
> 
> I was seeing test failures on Darwin in both the APR testsuite and httpd perl-framework.
 The %lld sprintf format character was incorrectly parsed, and "%ld" written instead of the
substituted value.  
> 
> This small patch against APR trunk fixes that: 
> 
> Index: strings/apr_snprintf.c
> ===================================================================
> --- strings/apr_snprintf.c	(revision 1031121)
> +++ strings/apr_snprintf.c	(working copy)
> @@ -832,6 +832,11 @@
>              else if (*fmt == 'l') {
>                  var_type = IS_LONG;
>                  fmt++;
> +                /* Catch the %lld type modifier for long long and its ilk */
> +                if (*fmt == 'l') {
> +                    var_type = IS_QUAD;
> +                    fmt++;
> +                }
>              }
>              else if (*fmt == 'h') {
>                  var_type = IS_SHORT;

Looks good here.

Mime
View raw message