Get rid of strlcpy()

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
Robert Baldyga
2024-05-11 00:30:56 +02:00
parent 5c4b5634cb
commit 9fc5e39349
3 changed files with 8 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -597,7 +598,7 @@ static inline int env_bit_test(int nr, const void *addr)
#define env_strncmp(s1, slen1, s2, slen2) strncmp(s1, s2, \
min_t(size_t, slen1, slen2))
#define env_strncpy(dest, dmax, src, slen) ({ \
strlcpy(dest, src, min_t(int, dmax, slen)); \
strscpy(dest, src, min_t(int, dmax, slen)); \
0; \
})