log.c: fix compiler warning

log.c:94:87: warning: format specifies type 'long' but the argument has type
      'int' [-Wformat]
  ...%03ld ", (unsigned long)pthread_self(), time_string, tv.tv_usec / 1000);
     ~~~~~                                                ^~~~~~~~~~~~~~~~~
     %03d
This commit is contained in:
Ludovic Rousseau 2016-02-29 18:01:52 +01:00
parent f29f2e62b3
commit 08529c91ee
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ static void sc_do_log_va(sc_context_t *ctx, int level, const char *file, int lin
gettimeofday (&tv, NULL);
tm = localtime (&tv.tv_sec);
strftime (time_string, sizeof(time_string), "%H:%M:%S", tm);
r = snprintf(p, left, "0x%lx %s.%03ld ", (unsigned long)pthread_self(), time_string, tv.tv_usec / 1000);
r = snprintf(p, left, "0x%lx %s.%03ld ", (unsigned long)pthread_self(), time_string, (long)tv.tv_usec / 1000);
#endif
p += r;
left -= r;