util/ConcatString: use std::copy_n() instead of memcpy()

This commit is contained in:
Max Kellermann
2017-05-16 11:56:19 +02:00
parent fea211a109
commit a4b1633e11

View File

@@ -30,6 +30,8 @@
#ifndef CONCAT_STRING_HXX #ifndef CONCAT_STRING_HXX
#define CONCAT_STRING_HXX #define CONCAT_STRING_HXX
#include <algorithm>
#include <string.h> #include <string.h>
template<typename... Args> template<typename... Args>
@@ -58,7 +60,7 @@ template<>
void void
StringCat(char *p, const size_t *lengths, const char *a) StringCat(char *p, const size_t *lengths, const char *a)
{ {
memcpy(p, a, *lengths); std::copy_n(a, *lengths, p);
} }
#endif #endif