Pass tv_sec and tv_nsec to LxtLogError in CheckTime (#40494)
The format string takes four scalars (sec, nsec, sec, nsec) but only two struct timespec pointers were being passed, so the diagnostic on failure printed garbage. Pass the four scalar fields with explicit casts to match the format specifiers. Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ben Hillis committed
May 11, 2026 at 20:58 UTC
19341180acfb26b53d3af69b315473d577efac66
1 file changed
+6
-1
test/linux/unit_tests/lxtfs.c
+6
-1
@@ -2231,7 +2231,12 @@ Return Value:
2231
2232
if (LxtFsTimestampDiff(Timestamp1, Timestamp2) <= 0)
2233
{
2234
- LxtLogError("Time %lld.%.9ld not greater than time %lld.%.9ld", Timestamp1, Timestamp2);
2234
+ LxtLogError(
2235
+ "Time %lld.%.9ld not greater than time %lld.%.9ld",
2236
+ (long long)Timestamp1->tv_sec,
2237
+ (long)Timestamp1->tv_nsec,
2238
+ (long long)Timestamp2->tv_sec,
2239
+ (long)Timestamp2->tv_nsec);
2240
2241
Result = LXT_RESULT_FAILURE;
2242
goto ErrorExit;