From b29695e1487331405c2d50c90faccba56c2e92f2 Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Thu, 17 Mar 2022 18:04:06 +0100 Subject: [PATCH] Replaced memcpy with manual while loop --- const_fmt/stdlib.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/const_fmt/stdlib.h b/const_fmt/stdlib.h index b963489..1636570 100644 --- a/const_fmt/stdlib.h +++ b/const_fmt/stdlib.h @@ -187,8 +187,10 @@ concept floating_point = is_floating_point_v; template -constexpr inline void copy(input_t* start, input_t* end, output_t* dest_start) { - memcpy(start, dest_start, end - start); +constexpr inline void copy(const input_t* start, const input_t* end, output_t* dest_start) { + auto temp = start; + while (temp != end) + *(dest_start++) = *(temp++); }