Set mainlog_name and rejectlog_name unconditionally.
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
Mon, 12 Apr 2021 06:41:44 +0000 (08:41 +0200)
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
Fri, 23 Apr 2021 20:55:39 +0000 (22:55 +0200)
(cherry picked from commit 3f06b9b4c7244b169d50bce216c1f54b4dfe7efb)

src/src/log.c

index 99eba5f905971c5c80bfb6b8e65ae92aa08e9a85..011c4debce0626cdee763ab1dc8f5344535dbde6 100644 (file)
@@ -402,18 +402,20 @@ it gets statted to see if it has been cycled. With a datestamp, the datestamp
 will be compared. The static slot for saving it is the same size as buffer,
 and the text has been checked above to fit, so this use of strcpy() is OK. */
 
-if (type == lt_main && string_datestamp_offset >= 0)
+if (type == lt_main)
   {
   Ustrcpy(mainlog_name, buffer);
-  mainlog_datestamp = mainlog_name + string_datestamp_offset;
+  if (string_datestamp_offset > 0)
+    mainlog_datestamp = mainlog_name + string_datestamp_offset;
   }
 
 /* Ditto for the reject log */
 
-else if (type == lt_reject && string_datestamp_offset >= 0)
+else if (type == lt_reject)
   {
   Ustrcpy(rejectlog_name, buffer);
-  rejectlog_datestamp = rejectlog_name + string_datestamp_offset;
+  if (string_datestamp_offset > 0)
+    rejectlog_datestamp = rejectlog_name + string_datestamp_offset;
   }
 
 /* and deal with the debug log (which keeps the datestamp, but does not