- if (*fmt == '%') {
- switch (fmt[1]) {
- case 0:
- return;
- case 'd':
- APPEND_FMT("%02d", tm->tm_mday);
- break;
- case 'h':
- APPEND_FMT("%02d", tm->tm_hour);
- break;
- case 'm':
- APPEND_FMT("%02d", tm->tm_mon + 1);
- break;
- case 'M':
- APPEND_FMT("%02d", tm->tm_min);
- break;
- case 'O':
- APPEND_FMT("%lo", (unsigned long)now);
- break;
- case 'p':
- APPEND_FMT("%u", (unsigned int)getpid());
- break;
- case 'P':
- APPEND_FMT("%c", MsgIdPfx);
- MsgIdPfx = (MsgIdPfx == 'Z') ? 'A' : MsgIdPfx + 1;
- break;
- case 'r':
- APPEND_FMT("%u", (unsigned int)rand());
- break;
- case 'R':
- APPEND_FMT("%x", (unsigned int)rand());
- break;
- case 's':
- APPEND_FMT("%02d", tm->tm_sec);
- break;
- case 'T':
- APPEND_FMT("%u", (unsigned int) now);
- break;
- case 'X':
- APPEND_FMT("%x", (unsigned int) now);
- break;
- case 'Y': /* this will break in the year 10000 ;-) */
- APPEND_FMT("%04d", tm->tm_year + 1900);
- break;
- case '%':
- APPEND_BYTE('%');
- break;
- default: /* invalid formats are replaced by '.' */
- APPEND_BYTE('.');
- m_strncat(buf, len, ".", 1);
- }
- ++fmt;
- } else {
- APPEND_BYTE(mutt_normalized_char(*fmt));
+ switch (*fmt++) {
+ case 0:
+ return;
+ case 'd':
+ APPEND_FMT("%02d", tm->tm_mday);
+ break;
+ case 'h':
+ APPEND_FMT("%02d", tm->tm_hour);
+ break;
+ case 'm':
+ APPEND_FMT("%02d", tm->tm_mon + 1);
+ break;
+ case 'M':
+ APPEND_FMT("%02d", tm->tm_min);
+ break;
+ case 'O':
+ APPEND_FMT("%lo", (unsigned long)now);
+ break;
+ case 'p':
+ APPEND_FMT("%u", (unsigned int)getpid());
+ break;
+ case 'P':
+ APPEND_FMT("%c", MsgIdPfx);
+ MsgIdPfx = (MsgIdPfx == 'Z') ? 'A' : MsgIdPfx + 1;
+ break;
+ case 'r':
+ APPEND_FMT("%u", (unsigned int)rand());
+ break;
+ case 'R':
+ APPEND_FMT("%x", (unsigned int)rand());
+ break;
+ case 's':
+ APPEND_FMT("%02d", tm->tm_sec);
+ break;
+ case 'T':
+ APPEND_FMT("%u", (unsigned int) now);
+ break;
+ case 'X':
+ APPEND_FMT("%x", (unsigned int) now);
+ break;
+ case 'Y': /* this will break in the year 10000 ;-) */
+ APPEND_FMT("%04d", tm->tm_year + 1900);
+ break;
+ case '%':
+ APPEND_BYTE('%');
+ break;
+ default: /* invalid formats are replaced by '.' */
+ APPEND_BYTE('.');
+ m_strncat(buf, len, ".", 1);