]> 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:34:18 +0000 (10:34 +0100)
commit98575bd6e7b143cc1ddbcce7415076cf95bcbf0c
tree547d02962ad10b96781fd1194b1ed2a5d6a54e91
parent532a29e8fa28e80e5fdd08a73c307a196542e222
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