From: Jeff Trawick Date: Wed, 8 Nov 2000 16:42:05 +0000 (+0000) Subject: Fix the format strings used for apr_port_t (APR_PORT_T_FMT anyone?). X-Git-Tag: APACHE_2_0_ALPHA_8~143 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0d2ff0a7a6b0091582bb67d70dee17b85818a99;p=apache Fix the format strings used for apr_port_t (APR_PORT_T_FMT anyone?). The sscanf() call was actually broken. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86871 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/rfc1413.c b/server/rfc1413.c index a981c77d34..8e5d3430bd 100644 --- a/server/rfc1413.c +++ b/server/rfc1413.c @@ -151,7 +151,7 @@ static int get_rfc1413(apr_socket_t *sock, const char *local_ip, apr_get_port(&sav_rmt_port, APR_REMOTE, sock); /* send the data */ - buflen = apr_snprintf(buffer, sizeof(buffer), "%u,%u\r\n", sav_rmt_port, + buflen = apr_snprintf(buffer, sizeof(buffer), "%hu,%hu\r\n", sav_rmt_port, sav_our_port); ap_xlate_proto_to_ascii(buffer, buflen); @@ -203,7 +203,7 @@ static int get_rfc1413(apr_socket_t *sock, const char *local_ip, /* RFC1413_USERLEN = 512 */ ap_xlate_proto_from_ascii(buffer, i); - if (sscanf(buffer, "%u , %u : USERID :%*[^:]:%512s", &rmt_port, &our_port, + if (sscanf(buffer, "%hu , %hu : USERID :%*[^:]:%512s", &rmt_port, &our_port, user) != 3 || sav_rmt_port != rmt_port || sav_our_port != our_port) return -1;