You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/18 19:54:58 UTC
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7349: gmtimer: Fixed range of tm_yday.
pkarashchenko commented on code in PR #7349:
URL: https://github.com/apache/incubator-nuttx/pull/7349#discussion_r998648301
##########
libs/libc/time/lib_gmtimer.c:
##########
@@ -336,7 +336,7 @@ FAR struct tm *gmtime_r(FAR const time_t *timep, FAR struct tm *result)
result->tm_wday = clock_dayoftheweek(day, month, year);
result->tm_yday = day +
clock_daysbeforemonth(result->tm_mon,
- clock_isleapyear(year));
+ clock_isleapyear(year)) - 1;
Review Comment:
maybe `day - 1 + clock_daysbeforemonth()` just for the style consistency? Or change to `tp->tm_mday + clock_daysbeforemonth() - 1` in other places?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org