diff options
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 79e31246a..003696a48 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -180,6 +180,8 @@ GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile) | |||
180 | if (logfile == NULL) | 180 | if (logfile == NULL) |
181 | return GNUNET_OK; | 181 | return GNUNET_OK; |
182 | fn = GNUNET_STRINGS_filename_expand (logfile); | 182 | fn = GNUNET_STRINGS_filename_expand (logfile); |
183 | if (NULL == fn) | ||
184 | return GNUNET_SYSERR; | ||
183 | dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn)); | 185 | dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn)); |
184 | altlog = FOPEN (fn, "a"); | 186 | altlog = FOPEN (fn, "a"); |
185 | if (altlog == NULL) | 187 | if (altlog == NULL) |
@@ -374,7 +376,10 @@ mylog (enum GNUNET_ErrorType kind, | |||
374 | time (&timetmp); | 376 | time (&timetmp); |
375 | memset (date, 0, DATE_STR_SIZE); | 377 | memset (date, 0, DATE_STR_SIZE); |
376 | tmptr = localtime (&timetmp); | 378 | tmptr = localtime (&timetmp); |
377 | strftime (date, DATE_STR_SIZE, "%b %d %H:%M:%S", tmptr); | 379 | if (NULL != tmptr) |
380 | strftime (date, DATE_STR_SIZE, "%b %d %H:%M:%S", tmptr); | ||
381 | else | ||
382 | strcpy (date, "localtime error"); | ||
378 | if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && | 383 | if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && |
379 | (last_bulk_time.value != 0) && | 384 | (last_bulk_time.value != 0) && |
380 | (0 == strncmp (buf, last_bulk, sizeof (last_bulk)))) | 385 | (0 == strncmp (buf, last_bulk, sizeof (last_bulk)))) |