From b26c119f4e535f617c9ffb10076f15c4ee54414d Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Mon, 22 Apr 2024 15:04:29 +0100 Subject: Tighten up some string arrays This is the normal way of declaring such things. Reviewed-by: Zhidao HONG Signed-off-by: Andrew Clayton --- src/nxt_controller.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nxt_controller.c') diff --git a/src/nxt_controller.c b/src/nxt_controller.c index 230a4d5d..30d5f04e 100644 --- a/src/nxt_controller.c +++ b/src/nxt_controller.c @@ -2652,11 +2652,12 @@ static u_char * nxt_controller_date(u_char *buf, nxt_realtime_t *now, struct tm *tm, size_t size, const char *format) { - static const char *week[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", - "Sat" }; + static const char * const week[] = { "Sun", "Mon", "Tue", "Wed", "Thu", + "Fri", "Sat" }; - static const char *month[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + static const char * const month[] = { "Jan", "Feb", "Mar", "Apr", "May", + "Jun", "Jul", "Aug", "Sep", "Oct", + "Nov", "Dec" }; return nxt_sprintf(buf, buf + size, format, week[tm->tm_wday], tm->tm_mday, -- cgit