From 83fb4b4da409d06958d4666cc163b64dbca59364 Mon Sep 17 00:00:00 2001 From: brectanus Date: Wed, 7 Nov 2007 20:22:09 +0000 Subject: [PATCH] Fix more formatting errors/warnings on 64bit systems. --- apache2/msc_geo.c | 4 ++-- apache2/msc_reqbody.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache2/msc_geo.c b/apache2/msc_geo.c index 4f0df69c..6693f05d 100644 --- a/apache2/msc_geo.c +++ b/apache2/msc_geo.c @@ -165,7 +165,7 @@ static int db_open(directory_config *dcfg, char **error_msg) fprintf(stderr, "GEO: read 0x%02x%02x%02x\n", buf[0], buf[1], buf[2]); #endif if ((rc != APR_SUCCESS) || (nbytes != 3)) { - *error_msg = apr_psprintf(mp, "Could not read from geo database \"%s\" (%d/3 bytes read): %s", geo->dbfn, nbytes, apr_strerror(rc, errstr, 1024)); + *error_msg = apr_psprintf(mp, "Could not read from geo database \"%s\" (%" APR_SIZE_T_FMT "/3 bytes read): %s", geo->dbfn, nbytes, apr_strerror(rc, errstr, 1024)); return -1; } if ((buf[0] == 0xff) && (buf[1] == 0xff) && (buf[2] == 0xff)) { @@ -190,7 +190,7 @@ static int db_open(directory_config *dcfg, char **error_msg) memset(buf, 0, 3); rc = apr_file_read_full(geo->db, &buf, 3, &nbytes); if ((rc != APR_SUCCESS) || (nbytes != 3)) { - *error_msg = apr_psprintf(mp, "Could not read geo database \"%s\" country offset (%d/3 bytes read): %s", geo->dbfn, nbytes, apr_strerror(rc, errstr, 1024)); + *error_msg = apr_psprintf(mp, "Could not read geo database \"%s\" country offset (%" APR_SIZE_T_FMT "/3 bytes read): %s", geo->dbfn, nbytes, apr_strerror(rc, errstr, 1024)); return -1; } #ifdef DEBUG_CONF diff --git a/apache2/msc_reqbody.c b/apache2/msc_reqbody.c index 8f96505d..d44efc97 100644 --- a/apache2/msc_reqbody.c +++ b/apache2/msc_reqbody.c @@ -197,7 +197,7 @@ static apr_status_t modsecurity_request_body_store_memory(modsec_rec *msr, msr->msc_reqbody_chunk_current = (msc_data_chunk *) apr_pcalloc(msr->msc_reqbody_mp, sizeof(msc_data_chunk)); if (msr->msc_reqbody_chunk_current == NULL) { - *error_msg = apr_psprintf(msr->mp, "Input filter: Failed to allocate %d bytes for request body chunk.", sizeof(msc_data_chunk)); + *error_msg = apr_psprintf(msr->mp, "Input filter: Failed to allocate %lu bytes for request body chunk.", (unsigned long)sizeof(msc_data_chunk)); return -1; } @@ -316,12 +316,12 @@ static apr_status_t modsecurity_request_body_end_urlencoded(modsec_rec *msr, cha /* Allocate a buffer large enough to hold the request body. */ if (msr->msc_reqbody_length + 1 == 0) { - *error_msg = apr_psprintf(msr->mp, "Internal error, request body length will overflow: %d", msr->msc_reqbody_length); + *error_msg = apr_psprintf(msr->mp, "Internal error, request body length will overflow: %u", msr->msc_reqbody_length); return -1; } msr->msc_reqbody_buffer = malloc(msr->msc_reqbody_length + 1); if (msr->msc_reqbody_buffer == NULL) { - *error_msg = apr_psprintf(msr->mp, "Unable to allocate memory to hold request body. Asked for %" APR_SIZE_T_FMT " bytes.", + *error_msg = apr_psprintf(msr->mp, "Unable to allocate memory to hold request body. Asked for %u bytes.", msr->msc_reqbody_length + 1); return -1; } @@ -442,7 +442,7 @@ apr_status_t modsecurity_request_body_retrieve_start(modsec_rec *msr, char **err msr->msc_reqbody_disk_chunk = apr_pcalloc(msr->msc_reqbody_mp, sizeof(msc_data_chunk)); if (msr->msc_reqbody_disk_chunk == NULL) { - *error_msg = apr_psprintf(msr->mp, "Failed to allocate %d bytes for request body disk chunk.", sizeof(msc_data_chunk)); + *error_msg = apr_psprintf(msr->mp, "Failed to allocate %lu bytes for request body disk chunk.", (unsigned long)sizeof(msc_data_chunk)); return -1; } msr->msc_reqbody_disk_chunk->is_permanent = 1; @@ -451,7 +451,7 @@ apr_status_t modsecurity_request_body_retrieve_start(modsec_rec *msr, char **err if (msr->msc_reqbody_storage == MSC_REQBODY_DISK) { msr->msc_reqbody_disk_chunk = apr_pcalloc(msr->msc_reqbody_mp, sizeof(msc_data_chunk)); if (msr->msc_reqbody_disk_chunk == NULL) { - *error_msg = apr_psprintf(msr->mp, "Failed to allocate %d bytes for request body disk chunk.", sizeof(msc_data_chunk)); + *error_msg = apr_psprintf(msr->mp, "Failed to allocate %lu bytes for request body disk chunk.", (unsigned long)sizeof(msc_data_chunk)); return -1; }