=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/format.c,v retrieving revision 1.304 retrieving revision 1.305 diff -c -r1.304 -r1.305 *** src/usr.bin/tmux/format.c 2022/05/30 13:07:06 1.304 --- src/usr.bin/tmux/format.c 2022/06/21 09:30:01 1.305 *************** *** 1,4 **** ! /* $OpenBSD: format.c,v 1.304 2022/05/30 13:07:06 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: format.c,v 1.305 2022/06/21 09:30:01 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott *************** *** 3387,3398 **** } /* Make a prettier time. */ ! static char * ! format_pretty_time(time_t t) { struct tm now_tm, tm; time_t now, age; ! char s[6]; time(&now); if (now < t) --- 3387,3398 ---- } /* Make a prettier time. */ ! char * ! format_pretty_time(time_t t, int seconds) { struct tm now_tm, tm; time_t now, age; ! char s[9]; time(&now); if (now < t) *************** *** 3404,3410 **** /* Last 24 hours. */ if (age < 24 * 3600) { ! strftime(s, sizeof s, "%H:%M", &tm); return (xstrdup(s)); } --- 3404,3413 ---- /* Last 24 hours. */ if (age < 24 * 3600) { ! if (seconds) ! strftime(s, sizeof s, "%H:%M:%S", &tm); ! else ! strftime(s, sizeof s, "%H:%M", &tm); return (xstrdup(s)); } *************** *** 3509,3515 **** if (t == 0) return (NULL); if (modifiers & FORMAT_PRETTY) ! found = format_pretty_time(t); else { if (time_format != NULL) { localtime_r(&t, &tm); --- 3512,3518 ---- if (t == 0) return (NULL); if (modifiers & FORMAT_PRETTY) ! found = format_pretty_time(t, 0); else { if (time_format != NULL) { localtime_r(&t, &tm);