]> granicus.if.org Git - apache/commitdiff
Too many args is a bad thing too, some days
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 10 Oct 2001 13:02:22 +0000 (13:02 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 10 Oct 2001 13:02:22 +0000 (13:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91398 13f79535-47bb-0310-9956-ffa450edef68

support/rotatelogs.c

index 6c674f8f7f08f70d89d503ce12aff81d4dae666c..5c407c301330129033048f73d4ce07494ed9fc67 100644 (file)
@@ -107,7 +107,7 @@ int main (int argc, char *argv[])
     atexit(apr_terminate);
 
     apr_pool_create(&pool, NULL);
-    if (argc < 3) {
+    if (argc < 3 || argc > 4) {
         fprintf(stderr,
                 "Usage: %s <logfile> <rotation time in seconds> "
                 "[offset minutes from UTC]\n\n",
@@ -140,7 +140,7 @@ int main (int argc, char *argv[])
         exit(6);
     }
 
-    use_strftime = (strstr(szLogRoot, "%") != NULL);
+    use_strftime = (strchr(szLogRoot, '%') != NULL);
     if (apr_file_open_stdin(&f_stdin, pool) != APR_SUCCESS) {
         fprintf(stderr, "Unable to open stdin\n");
         exit(1);