1
0
Fork 0

Make use of template variable, and reformat whitespace

This commit is contained in:
krcroft 2019-12-08 19:58:20 -08:00 committed by Patryk Obara
parent c34670aba0
commit 78cc6be86d
3 changed files with 48 additions and 30 deletions

View file

@ -57,8 +57,7 @@ char * safe_strcpy(char (& dst)[N], const char * src) noexcept {
template<size_t N>
char * safe_strcat(char (& dst)[N], const char * src) noexcept {
const size_t dst_size = sizeof(dst);
strncat(dst, src, dst_size - strnlen(dst, dst_size) - 1);
strncat(dst, src, N - strnlen(dst, N) - 1);
return & dst[0];
}