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/08/04 12:50:44 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6783: libc/localtime: fix ats over time_t range

pkarashchenko commented on code in PR #6783:
URL: https://github.com/apache/incubator-nuttx/pull/6783#discussion_r937739405


##########
libs/libc/time/lib_localtime.c:
##########
@@ -676,23 +668,22 @@ static int tzload(FAR const char *name,
       for (i = 0; i < sp->timecnt; ++i)
         {
           int_fast64_t at = stored == 4 ? detzcode(p) : detzcode64(p);
-          sp->types[i] = ((TYPE_SIGNED(time_t)
-                           ? g_min_timet <= at : 0 <= at) &&
-                           at <= g_max_timet);
+          sp->types[i] = at <= g_max_timet;
           if (sp->types[i])
             {
-              if (i && !timecnt && at != g_min_timet)
+              int_fast64_t attime = at < g_min_timet ? g_min_timet : at;

Review Comment:
   how int64 value can be less than `INT64_MIN`? I mean what are the values to get this condition evaluated to `true`?



-- 
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