Show a time transition. */
| 1083 | |
| 1084 | /* Show a time transition. */ |
| 1085 | static void |
| 1086 | showtrans(char const *time_fmt, struct tm const *tm, time_t t, char const *ab, |
| 1087 | char const *zone_name) |
| 1088 | { |
| 1089 | if (!tm) { |
| 1090 | printf(tformat(), t); |
| 1091 | putchar('\n'); |
| 1092 | } else { |
| 1093 | char stackbuf[1000]; |
| 1094 | ptrdiff_t size = sizeof stackbuf; |
| 1095 | char *buf = stackbuf; |
| 1096 | char *bufalloc = NULL; |
| 1097 | while (! istrftime(buf, size, time_fmt, tm, t, ab, zone_name)) { |
| 1098 | size = sumsize(size, size); |
| 1099 | free(bufalloc); |
| 1100 | buf = bufalloc = xmalloc(size); |
| 1101 | } |
| 1102 | puts(buf); |
| 1103 | free(bufalloc); |
| 1104 | } |
| 1105 | } |
| 1106 | |
| 1107 | static char const * |
| 1108 | abbr(struct tm const *tmp) |