/
niceSOFT
/
shadow
Обзор
Документация
Войти
/
niceSOFT
/
shadow
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/string/strcpy/stpecpy.h
45 строк
841 B
Alejandro Colomar
lib/string/strcpy/: stpecpy(): Use strtcpy() instead of its pattern
15 май 2026, 13:06
15 май 2026, 13:06
16cac21
Код
Авторство
О чём код?
// SPDX-FileCopyrightText: 2022-2024, Alejandro Colomar <alx@kernel.org> // SPDX-License-Identifier: BSD-3-Clause #ifndef SHADOW_INCLUDE_LIB_STRING_STRCPY_STPECPY_H_ #define SHADOW_INCLUDE_LIB_STRING_STRCPY_STPECPY_H_ #include "config.h" #include <errno.h> #include <stdbool.h> #include <stddef.h> #include <string.h> #include "attr.h" #include "string/strcpy/strtcpy.h" #if !defined(HAVE_STPECPY) // stpecpy - string offset-pointer end-pointer copy ATTR_STRING(3) inline char *stpecpy(char *dst, const char *end, const char *restrict src); #endif #if !defined(HAVE_STPECPY) inline char * stpecpy(char *dst, const char *end, const char *restrict src) { ssize_t dlen; if (dst == NULL) return NULL; dlen = strtcpy(dst, src, end - dst); if (dlen == -1) return NULL; return dst + dlen; } #endif #endif // include guard