diff options
author | jorton <jorton@13f79535-47bb-0310-9956-ffa450edef68> | 2003-10-01 21:08:17 +0000 |
---|---|---|
committer | jorton <jorton@13f79535-47bb-0310-9956-ffa450edef68> | 2003-10-01 21:08:17 +0000 |
commit | 8b427e5bc6be949fcfddfe33a0811fd0e38ac085 (patch) | |
tree | 80fa0e700a7dec1d3871bfc85c1f837b4f20b68c /strings | |
parent | 501063bc0defaec43dd8bf406ed544a0629ba8ee (diff) | |
download | libapr-8b427e5bc6be949fcfddfe33a0811fd0e38ac085.tar.gz |
* configure.in, include/apr.h.in, include/apr.hw, include/apr.hnw:
Remove definitions of APR_INT64_T_FMT_LEN, APR_UINT64_T_FMT_LEN and
APR_UINT64_T_HEX_FMT_LEN. Die at configure-time if a 64-bit integer
type is not found rather than placing "#error"s in apr.h.
* strings/apr_snprintf.c (apr_vformatter): Rework to use sizeof()
rather than APR_INT64_T_FMT_LEN. One (intensional) functional change,
for the sizeof(int) == 8 case: previously the first if condition would
always be true since strncmp(a, b, 0) == 0; now the condition will
always be false.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64675 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'strings')
-rw-r--r-- | strings/apr_snprintf.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index cab365936..7ac3d9b47 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -838,17 +838,17 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), adjust_precision = adjust_width = NO; /* - * Modifier check + * Modifier check. Note that if APR_INT64_T_FMT is "d", + * the first if condition is never true. */ -#if defined(APR_INT64_T_FMT_LEN) && (APR_INT64_T_FMT_LEN == 3) - if ((*fmt == APR_INT64_T_FMT[0]) && - (fmt[1] == APR_INT64_T_FMT[1])) { -#elif defined(APR_INT64_T_FMT_LEN) && (APR_INT64_T_FMT_LEN == 2) - if (*fmt == APR_INT64_T_FMT[0]) { -#else - if (strncmp(fmt, APR_INT64_T_FMT, - sizeof(APR_INT64_T_FMT) - 2) == 0) { -#endif + if ((sizeof(APR_INT64_T_FMT) == 4 && + fmt[0] == APR_INT64_T_FMT[0] && + fmt[1] == APR_INT64_T_FMT[1]) || + (sizeof(APR_INT64_T_FMT) == 3 && + fmt[0] == APR_INT64_T_FMT[0]) || + (sizeof(APR_INT64_T_FMT) > 4 && + strncmp(fmt, APR_INT64_T_FMT, + sizeof(APR_INT64_T_FMT) - 2) == 0)) { /* Need to account for trailing 'd' and null in sizeof() */ var_type = IS_QUAD; fmt += (sizeof(APR_INT64_T_FMT) - 2); |