diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-10 21:28:38 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-10 21:28:38 +0200 |
commit | 63d2555c9cefbbeeca3ec87fdd5d241e9488f9dd (patch) | |
tree | f96d5dcd14268406b6c78c002f9bb63db7fc9cb9 /src/nbdebug.c | |
parent | 4ca41534b726c4116d2e430e877e34146b4d4831 (diff) | |
download | vim-git-63d2555c9cefbbeeca3ec87fdd5d241e9488f9dd.tar.gz |
patch 8.1.1313: warnings for using localtime() and ctime()v8.1.1313
Problem: Warnings for using localtime() and ctime().
Solution: Use localtime_r() if available. Avoid using ctime().
Diffstat (limited to 'src/nbdebug.c')
-rw-r--r-- | src/nbdebug.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nbdebug.c b/src/nbdebug.c index b76d9caf0..2af0288ce 100644 --- a/src/nbdebug.c +++ b/src/nbdebug.c @@ -80,12 +80,13 @@ nbdebug_log_init( char *file; /* possible nb_debug output file */ char *cp; /* nb_dlevel pointer */ - if (log_var && (file = getenv(log_var)) != NULL) { + if (log_var && (file = getenv(log_var)) != NULL) + { time_t now; nb_debug = fopen(file, "a"); time(&now); - fprintf(nb_debug, "%s", asctime(localtime(&now))); + fprintf(nb_debug, "%s", get_ctime(now, TRUE)); if (level_var && (cp = getenv(level_var)) != NULL) { nb_dlevel = strtoul(cp, NULL, 0); } else { |