Skip to content

make time_t format string work for all types of time_t #366

Merged
ZerBea merged 1 commit intoZerBea:masterfrom
buzzdeee:time_t_format_string
Feb 3, 2026
Merged

make time_t format string work for all types of time_t #366
ZerBea merged 1 commit intoZerBea:masterfrom
buzzdeee:time_t_format_string

Conversation

@buzzdeee
Copy link
Contributor

@buzzdeee buzzdeee commented Feb 3, 2026

Not every OS has time_t defined as long. As for example OpenBSD uses long long.

Therefore there are ugly warnings I see when building hcxpcapngtool on OpenBSD
about the format string.

To fix it, use %jd and cast the variable to intmax_t.
This should be standardized and available since C99.

@ZerBea ZerBea merged commit f5adff2 into ZerBea:master Feb 3, 2026
2 checks passed
@ZerBea
Copy link
Owner

ZerBea commented Feb 3, 2026

Good point. Thanks
Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants