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


##########
libs/libc/time/lib_localtime.c:
##########
@@ -464,64 +554,48 @@ static void settzname(void)
     {
       FAR const struct ttinfo_s *const ttisp = &sp->ttis[i];
 
-      tzname[ttisp->tt_isdst] = &sp->chars[ttisp->tt_abbrind];
+      tzname[ttisp->tt_isdst] = &sp->chars[ttisp->tt_desigidx];
     }
 
   for (i = 0; i < sp->timecnt; ++i)
     {
       FAR const struct ttinfo_s *const ttisp = &sp->ttis[sp->types[i]];
 
-      tzname[ttisp->tt_isdst] = &sp->chars[ttisp->tt_abbrind];
-    }
-
-  /* Finally, scrub the abbreviations.  First, replace bogus characters. */
-
-  for (i = 0; i < sp->charcnt; ++i)
-    {
-      if (strchr(TZ_ABBR_CHAR_SET, sp->chars[i]) == NULL)
-        {
-          sp->chars[i] = TZ_ABBR_ERR_CHAR;
-        }
+      tzname[ttisp->tt_isdst] = &sp->chars[ttisp->tt_desigidx];
     }
+}
 
-  /* Second, truncate long abbreviations. */
+static int_fast32_t leapcorr(FAR struct state_s const *sp, time_t t)
+{
+  FAR struct lsinfo_s const *lp;

Review Comment:
   Done!



##########
libs/libc/time/lib_localtime.c:
##########
@@ -578,22 +653,36 @@ static int tzload(FAR const char *name,
   doaccess = name[0] == '/';
   if (!doaccess)
     {
-      p = TZDIR;
-      if (p == NULL ||
-          FILENAME_MAX <= strlen(p) + strlen(name))
+      char const *dot;
+      size_t namelen = strlen(name);
+      char const tzdirslash[sizeof TZDIR] = TZDIR "/";

Review Comment:
   Done!



##########
libs/libc/time/lib_localtime.c:
##########
@@ -578,22 +653,36 @@ static int tzload(FAR const char *name,
   doaccess = name[0] == '/';
   if (!doaccess)
     {
-      p = TZDIR;
-      if (p == NULL ||
-          FILENAME_MAX <= strlen(p) + strlen(name))
+      char const *dot;

Review Comment:
   Done!



##########
libs/libc/time/lib_localtime.c:
##########
@@ -578,22 +653,36 @@ static int tzload(FAR const char *name,
   doaccess = name[0] == '/';
   if (!doaccess)
     {
-      p = TZDIR;
-      if (p == NULL ||
-          FILENAME_MAX <= strlen(p) + strlen(name))
+      char const *dot;
+      size_t namelen = strlen(name);
+      char const tzdirslash[sizeof TZDIR] = TZDIR "/";
+
+      if (sizeof fullname - sizeof tzdirslash <= namelen)

Review Comment:
   Done!



-- 
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-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to