Skip to content

Commit

Permalink
Fixed security warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant-ON committed Apr 27, 2021
1 parent c959f34 commit 939998d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/stlink-lib/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ int ugly_log(int level, const char *tag, const char *format, ...) {
va_list args;
va_start(args, format);
time_t mytt = time(NULL);
struct tm *tt;
tt = localtime(&mytt);
fprintf(stderr, "%d-%02d-%02dT%02d:%02d:%02d ", tt->tm_year + 1900,
tt->tm_mon + 1, tt->tm_mday, tt->tm_hour, tt->tm_min, tt->tm_sec);
struct tm tt;
localtime_r(&mytt, &tt);
fprintf(stderr, "%d-%02d-%02dT%02d:%02d:%02d ", tt.tm_year + 1900,
tt.tm_mon + 1, tt.tm_mday, tt.tm_hour, tt.tm_min, tt.tm_sec);

switch (level) {
case UDEBUG:
Expand Down

0 comments on commit 939998d

Please sign in to comment.