git: 692c0a2e80c1 - stable/14 - lastcomm: improve timestamp display

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Sun, 07 Jan 2024 01:27:33 UTC
The branch stable/14 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=692c0a2e80c1df7e401c803bebe165923044e223

commit 692c0a2e80c1df7e401c803bebe165923044e223
Author:     Michael Paepcke <git@paepcke.de>
AuthorDate: 2023-07-27 08:28:50 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-01-07 01:27:18 +0000

    lastcomm: improve timestamp display
    
    Adjust the lastcomm command to output timestamps with a precision of
    seconds.
    
    Reported by:    Dr. Andreas Longwitz
    Reviewed by:    emaste
    Relnotes:       Yes
    Sponsored by:   DSS Gmbh
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/802
    
    (cherry picked from commit 6f4ce7e89ba4fa52566704533920352aa65c7f9b)
---
 usr.bin/lastcomm/lastcomm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.bin/lastcomm/lastcomm.c b/usr.bin/lastcomm/lastcomm.c
index bcd84b2ed37a..b97755e7bb03 100644
--- a/usr.bin/lastcomm/lastcomm.c
+++ b/usr.bin/lastcomm/lastcomm.c
@@ -191,7 +191,7 @@ main(int argc, char *argv[])
 				    localtime(&ab.ac_btime));
 				(void)printf(" %s", buf);
 			} else
-				(void)printf(" %.16s", ctime(&ab.ac_btime));
+				(void)printf(" %.19s", ctime(&ab.ac_btime));
 		}
 		
 		/* exit time (starting time + elapsed time )*/
@@ -203,7 +203,7 @@ main(int argc, char *argv[])
 				    localtime(&t));
 				(void)printf(" %s", buf);
 			} else
-				(void)printf(" %.16s", ctime(&t));
+				(void)printf(" %.19s", ctime(&t));
 		}
 		printf("\n");
  	}