mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
libdvbsub/Debug.cpp: Fix format warnings for __suseconds64_t in Debug.cpp
- Added <inttypes.h> for correct format specifiers. - Used PRIdMAX for formatting __suseconds64_t in print function. - Updated sprintf call to handle __suseconds64_t correctly.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <inttypes.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <cstdio>
|
||||
@@ -42,13 +43,11 @@ void Debug::print(int level, const char *fmt, ...)
|
||||
if (level < level_) {
|
||||
gettimeofday(&tv, NULL);
|
||||
strftime(tbuf, sizeof(tbuf), "%H:%M:%S", localtime(&tv.tv_sec));
|
||||
len = sprintf(buf, "[ %s.%03ld ] ", tbuf, tv.tv_usec / 1000);
|
||||
len = sprintf(buf, "[ %s.%03" PRIdMAX " ] ", tbuf, static_cast<intmax_t>(tv.tv_usec / 1000));
|
||||
|
||||
va_start(argp, fmt);
|
||||
//vfprintf(fp_, fmt, argp);
|
||||
vsnprintf (&buf[len], 512, fmt, argp);
|
||||
vsnprintf(&buf[len], sizeof(buf) - len, fmt, argp);
|
||||
va_end(argp);
|
||||
fprintf(fp_, "%s", buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user