]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Jan 2025 09:30:52 +0000 (10:30 +0100)
commit2ea605f61e9a94ae5b6a8ddfa23d1e75cbded40a
treef8ecc33e945e1f6002a30680e86db2a21528bbcf
parent385c4fdbffa6e8e8c7cda48e0c7f8bf433bde97d
smb: server: Fix building with GCC 15

[ Upstream commit e18655cf35a5958fbf4ae9ca3ebf28871a3a1801 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/server/smb_common.c