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.


Origin commit data
------------------
Branch: ni/coolstream
Commit: a23f84104f
Author: Thilo Graf <dbt@novatux.de>
Date: 2024-09-02 (Mon, 02 Sep 2024)



------------------
This commit was generated by Migit
This commit is contained in:
2024-09-02 21:06:01 +02:00
committed by vanhofen
parent aee3131709
commit b94589b497

View File

@@ -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);
}
}