Closed hezy0426 closed 11 months ago
I haven't read the code much, but I have a vague suspicion about this part:
... for (int i = 1; i < month; i++) { days += *ptr; ptr++; } ...
The fact is that in the struct tm month is 0-based:
struct tm
If everything is OK and I'm worrying in vain - tell me and I'll merge the PR into the master.
Hi sir,
Amazing catch there! I have updated the code so that it will work with 0 based tm_mon. Quick and random screenshot to show you the result of printing 2023/12/31.
Thank you!
I haven't read the code much, but I have a vague suspicion about this part:
The fact is that in the
struct tm
month is 0-based:If everything is OK and I'm worrying in vain - tell me and I'll merge the PR into the master.