tidying
[exim.git] / src / src / exim.c
index a8f3c2248761c64c8a78dd58ab039cc1ff0468d6..9d87c8daa468a76919b68717dd57f6adbe71d18a 100644 (file)
@@ -3138,8 +3138,7 @@ for (i = 1; i < argc; i++)
 
       case 'm':
       case 'o':
-       if (!*argrest) {}
-       else badarg = TRUE;
+       if (*argrest) badarg = TRUE;
        break;
 
       /* -oP <name>: set pid file path for daemon
@@ -3157,27 +3156,24 @@ for (i = 1; i < argc; i++)
 
       case 'r':
       case 's':
-       if (!*argrest)
-         {
-         int *tp = (*argrest == 'r')?
-           &arg_receive_timeout : &arg_smtp_receive_timeout;
-         if (argrest[1] == 0)
-           {
-           if (i+1 < argc) *tp= readconf_readtime(argv[++i], 0, FALSE);
-           }
-         else *tp = readconf_readtime(argrest + 1, 0, FALSE);
-         if (*tp < 0)
-           exim_fail("exim: bad time value %s: abandoned\n", argv[i]);
-         }
-       else badarg = TRUE;
+       {
+       int * tp = argrest[-1] == 'r'
+         ? &arg_receive_timeout : &arg_smtp_receive_timeout;
+       if (*argrest)
+         *tp = readconf_readtime(argrest, 0, FALSE);
+       else if (i+1 < argc)
+         *tp = readconf_readtime(argv[++i], 0, FALSE);
+
+       if (*tp < 0)
+         exim_fail("exim: bad time value %s: abandoned\n", argv[i]);
+       }
        break;
 
       /* -oX <list>: Override local_interfaces and/or default daemon ports */
 
       case 'X':
-       if (!*argrest)
-         override_local_interfaces = argv[++i];
-       else badarg = TRUE;
+       if (*argrest) badarg = TRUE;
+       else override_local_interfaces = argv[++i];
        break;
 
       /* Unknown -o argument */
@@ -4363,7 +4359,7 @@ if (list_queue)
 if (count_queue)
   {
   set_process_info("counting the queue");
-  queue_count();
+  fprintf(stdout, "%u\n", queue_count());
   exit(EXIT_SUCCESS);
   }
 
@@ -4631,10 +4627,10 @@ turn into a queue runner, with an optional starting message id. */
 if (queue_interval == 0 && !f.daemon_listen)
   {
   DEBUG(D_queue_run) debug_printf("Single queue run%s%s%s%s\n",
-    (start_queue_run_id == NULL)? US"" : US" starting at ",
-    (start_queue_run_id == NULL)? US"" : start_queue_run_id,
-    (stop_queue_run_id == NULL)?  US"" : US" stopping at ",
-    (stop_queue_run_id == NULL)?  US"" : stop_queue_run_id);
+    start_queue_run_id ? US" starting at " : US"",
+    start_queue_run_id ? start_queue_run_id: US"",
+    stop_queue_run_id ?  US" stopping at " : US"",
+    stop_queue_run_id ?  stop_queue_run_id : US"");
   if (*queue_name)
     set_process_info("running the '%s' queue (single queue run)", queue_name);
   else