]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Kill the hardcoded values
authorTakashi Sato <takashi@apache.org>
Tue, 19 May 2009 12:26:14 +0000 (12:26 +0000)
committerTakashi Sato <takashi@apache.org>
Tue, 19 May 2009 12:26:14 +0000 (12:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@776290 13f79535-47bb-0310-9956-ffa450edef68

support/logresolve.c

index e808acbff37008311dc7521b61f62ee678b585ad..b99041a647d23e5a518b6ddfb985da296d99cf21 100644 (file)
@@ -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 @@ int main(int argc, const char * const argv[])
     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 @@ int main(int argc, const char * const argv[])
 
     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') {