From: Jeff Trawick Date: Wed, 1 May 2002 17:02:20 +0000 (+0000) Subject: use ap_snprintf() instead of snprintf() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19138ad5555ebf8bd6460aee671cd216a444df4f;p=thirdparty%2Fapache%2Fhttpd.git use ap_snprintf() instead of snprintf() this fixes a build error on OS/390 which, in version V2R8 at least, doesn't have snprintf() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94895 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/support/ab.c b/src/support/ab.c index a7b34eecd7e..3f24335604a 100644 --- a/src/support/ab.c +++ b/src/support/ab.c @@ -1224,8 +1224,8 @@ static void test(void) he = gethostbyname(connecthost); if (!he) { char theerror[1024]; - snprintf(theerror, sizeof(theerror), - "Bad hostname: %s\n", connecthost); + ap_snprintf(theerror, sizeof(theerror), + "Bad hostname: %s\n", connecthost); err(theerror); } server.sin_family = he->h_addrtype; @@ -1243,37 +1243,37 @@ static void test(void) /* setup request */ if (posting <= 0) { - snprintf(request, sizeof(request), - "%s %s HTTP/1.0\r\n" - "User-Agent: ApacheBench/%s\r\n" - "%s" "%s" "%s" - "Host: %s%s\r\n" - "Accept: */*\r\n" - "%s" "\r\n", - (posting == 0) ? "GET" : "HEAD", - url_on_request, - VERSION, - keepalive ? "Connection: Keep-Alive\r\n" : "", - cookie, auth, - hostname,colonport, hdrs); + ap_snprintf(request, sizeof(request), + "%s %s HTTP/1.0\r\n" + "User-Agent: ApacheBench/%s\r\n" + "%s" "%s" "%s" + "Host: %s%s\r\n" + "Accept: */*\r\n" + "%s" "\r\n", + (posting == 0) ? "GET" : "HEAD", + url_on_request, + VERSION, + keepalive ? "Connection: Keep-Alive\r\n" : "", + cookie, auth, + hostname,colonport, hdrs); } else { - snprintf(request, sizeof(request), - "POST %s HTTP/1.0\r\n" - "User-Agent: ApacheBench/%s\r\n" - "%s" "%s" "%s" - "Host: %s%s\r\n" - "Accept: */*\r\n" - "Content-length: %d\r\n" - "Content-type: %s\r\n" - "%s" - "\r\n", - url_on_request, - VERSION, - keepalive ? "Connection: Keep-Alive\r\n" : "", - cookie, auth, - hostname, colonport, postlen, - (content_type[0]) ? content_type : "text/plain", hdrs); + ap_snprintf(request, sizeof(request), + "POST %s HTTP/1.0\r\n" + "User-Agent: ApacheBench/%s\r\n" + "%s" "%s" "%s" + "Host: %s%s\r\n" + "Accept: */*\r\n" + "Content-length: %d\r\n" + "Content-type: %s\r\n" + "%s" + "\r\n", + url_on_request, + VERSION, + keepalive ? "Connection: Keep-Alive\r\n" : "", + cookie, auth, + hostname, colonport, postlen, + (content_type[0]) ? content_type : "text/plain", hdrs); } if (verbosity >= 2) @@ -1346,14 +1346,14 @@ static void test(void) static void copyright(void) { if (!use_html) { - printf("This is ApacheBench, Version %s\n", VERSION " <$Revision: 1.62 $> apache-1.3"); + printf("This is ApacheBench, Version %s\n", VERSION " <$Revision: 1.63 $> apache-1.3"); printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n"); printf("\n"); } else { printf("

\n"); - printf(" This is ApacheBench, Version %s <%s> apache-1.3
\n", VERSION, "$Revision: 1.62 $"); + printf(" This is ApacheBench, Version %s <%s> apache-1.3
\n", VERSION, "$Revision: 1.63 $"); printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
\n"); printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
\n"); printf("

\n

\n"); @@ -1447,7 +1447,7 @@ static int parse_url(char * purl) #endif (port != 80))) { - snprintf(colonport,sizeof(colonport),":%d",port); + ap_snprintf(colonport,sizeof(colonport),":%d",port); } else { colonport[0] = '\0'; }