git: cc61cc7b638a - main - ls(1): Preserve const qualifier on strstr(3) result

From: Faraz Vahedi <kfv_at_FreeBSD.org>
Date: Sat, 19 Sep 2026 10:18:34 UTC
The branch main has been updated by kfv:

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

commit cc61cc7b638a6a1182c0dd0989a7b630759f408c
Author:     Faraz Vahedi <kfv@FreeBSD.org>
AuthorDate: 2026-09-19 10:15:10 +0000
Commit:     Faraz Vahedi <kfv@FreeBSD.org>
CommitDate: 2026-09-19 10:15:10 +0000

    ls(1): Preserve const qualifier on strstr(3) result
    
    Reviewed by:    fuz
    Approved by:    fuz (mentor)
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D59774
---
 bin/ls/print.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ls/print.c b/bin/ls/print.c
index a504ec63dc26..3dfb16672a51 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -436,8 +436,8 @@ printdev(size_t width, dev_t dev)
 static void
 ls_strftime(char *str, size_t len, const char *fmt, const struct tm *tm)
 {
-	char *posb, nfmt[BUFSIZ];
-	const char *format = fmt;
+	char nfmt[BUFSIZ];
+	const char *posb, *format = fmt;
 
 	if ((posb = strstr(fmt, "%b")) != NULL) {
 		if (month_max_size == 0) {