aboutsummaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-07-23 07:59:30 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-07-23 07:59:30 +0200
commit9aabd792ddba2f2baf31f14a55a21ab6b646d21d (patch)
treeee05aeaa4b22052e57e16922c453b019219240b3 /src/log.c
parent486645a1b6ed3a12c938201e7729b4aeed5e1f93 (diff)
parentb821e069cd21d212e64cbacc1d3dd1bd22419623 (diff)
Merge branch 'master' into feature/jail_protocol
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/log.c b/src/log.c
index 98b9d95..20e9444 100644
--- a/src/log.c
+++ b/src/log.c
@@ -14,8 +14,8 @@
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
- * - Neither the name of the Yellow Lemon Software nor the names of its
- * contributors may be used to endorse or promote products derived from this
+ * - The names of its contributors may not be used to endorse or promote
+ * products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
@@ -35,6 +35,7 @@
#include <time.h>
#include "log.h"
+#include "compat.h"
log_priority log_prio = NOTICE;
log_open_cb log_open = NULL;
@@ -48,12 +49,12 @@ char *
curtime_str(char *buf, size_t siz)
{
time_t t;
- struct tm *tmp;
+ struct tm *tmp, res;
t = time(NULL);
- tmp = localtime(&t);
+ tmp = potd_localtime(&t, &res);
- if (!strftime(buf, siz, "%d %b %y - %H:%M:%S", tmp))
+ if (tmp && !strftime(buf, siz, "%d %b %y - %H:%M:%S", tmp))
snprintf(buf, siz, "%s", "UNKNOWN_TIME");
return buf;