/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
util/generic/strfcpy.h
17 строк
524 B
qkrorlqr
Initial NBS OpenSource export
28 апр 2023, 21:54
28 апр 2023, 21:54
783a858
Код
Авторство
О чём код?
#pragma once /* * strfcpy is a faster version of strlcpy(). * It returns void thus does not wastes time computing * (most likely, unneeded) strlen(str) * * Comparison with other copying functions: * strcpy() - buffer overflow ready * strncpy() - wastes time filling exactly n bytes with 0 * strlcpy() - wastes time searching for the length of src * memcpy() - wastes time copying exactly n bytes even if the string is shorter */ #include <stddef.h> void strfcpy(char* dst, const char* src, size_t n);