- char buffer[80];
- static char result[80];
-
- if (!tw)
- return NULL;
-
- /* Display timezone if known */
- if ((tw->tw_flags & TW_SZONE) == TW_SZNIL)
- result[0] = '\0';
- else
- snprintf(result, sizeof(result), " %s", dtimezone(tw->tw_zone, tw->tw_flags | flags));
-
- snprintf(buffer, sizeof(buffer), "%02d %s %0*d %02d:%02d:%02d%s",
- tw->tw_mday, tw_moty[tw->tw_mon],
- tw->tw_year < 100 ? 2 : 4, tw->tw_year,
- tw->tw_hour, tw->tw_min, tw->tw_sec, result);
-
- if ((tw->tw_flags & TW_SDAY) == TW_SEXP)
- snprintf (result, sizeof(result), "%s, %s", tw_dotw[tw->tw_wday], buffer);
- else
- if ((tw->tw_flags & TW_SDAY) == TW_SNIL)
- strncpy (result, buffer, sizeof(result));
+ char buffer[80];
+ static char result[80];
+
+ if (!tw)
+ return NULL;
+
+ /* Display timezone if known */
+ if ((tw->tw_flags & TW_SZONE) == TW_SZNIL)
+ result[0] = '\0';
+ else
+ snprintf(result, sizeof(result), " %s", dtimezone(tw->tw_zone, tw->tw_flags));
+
+ snprintf(buffer, sizeof(buffer), "%02d %s %0*d %02d:%02d:%02d%s",
+ tw->tw_mday, tw_moty[tw->tw_mon],
+ tw->tw_year < 100 ? 2 : 4, tw->tw_year,
+ tw->tw_hour, tw->tw_min, tw->tw_sec, result);
+
+ if ((tw->tw_flags & TW_SDAY) == TW_SEXP)
+ snprintf(result, sizeof(result), "%s, %s", tw_dotw[tw->tw_wday], buffer);