]> www.infradead.org Git - users/jedix/linux-maple.git/commit
smb: server: Fix building with GCC 15
authorBrahmajit Das <brahmajit.xyz@gmail.com>
Tue, 26 Nov 2024 06:11:35 +0000 (11:41 +0530)
committerSteve French <stfrench@microsoft.com>
Sun, 1 Dec 2024 23:31:19 +0000 (17:31 -0600)
commite18655cf35a5958fbf4ae9ca3ebf28871a3a1801
treed7d5ec59412e36d2d8fc7df9f18cdd6a09d34f60
parent40384c840ea1944d7c5a392e8975ed088ecf0b37
smb: server: Fix building with GCC 15

GCC 15 introduces -Werror=unterminated-string-initialization by default,
this results in the following build error

fs/smb/server/smb_common.c:21:35: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-ini
tialization]
   21 | static const char basechars[43] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_-!@#$%";
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

To this we are replacing char basechars[43] with a character pointer
and then using strlen to get the length.

Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/smb_common.c