You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ta...@apache.org on 2009/05/19 14:26:15 UTC

svn commit: r776290 - /httpd/httpd/trunk/support/logresolve.c

Author: takashi
Date: Tue May 19 12:26:14 2009
New Revision: 776290

URL: http://svn.apache.org/viewvc?rev=776290&view=rev
Log:
Kill the hardcoded values

Modified:
    httpd/httpd/trunk/support/logresolve.c

Modified: httpd/httpd/trunk/support/logresolve.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/logresolve.c?rev=776290&r1=776289&r2=776290&view=diff
==============================================================================
--- httpd/httpd/trunk/support/logresolve.c (original)
+++ httpd/httpd/trunk/support/logresolve.c Tue May 19 12:26:14 2009
@@ -68,6 +68,8 @@
 #include <stdlib.h>
 #endif
 
+#define LINE_BUF_SIZE 2048
+
 static apr_file_t *errfile;
 static const char *shortname = "logresolve";
 static apr_hash_t *cache;
@@ -143,7 +145,7 @@
     char * inbuffer;
     char * outbuffer;
 #endif
-    char line[2048];
+    char line[LINE_BUF_SIZE];
     int doublelookups = 0;
 
     if (apr_app_initialize(&argc, &argv, NULL) != APR_SUCCESS) {
@@ -204,7 +206,7 @@
 
     cache = apr_hash_make(pool);
 
-    while (apr_file_gets(line, 2048, infile) == APR_SUCCESS) {
+    while (apr_file_gets(line, sizeof(line), infile) == APR_SUCCESS) {
         char dummy[] = " " APR_EOL_STR;
 
         if (line[0] == '\0') {