/* Copyright (C) 2015-2020, Dirk Krause SPDX-License-Identifier: BSD-3-Clause */ /* WARNING: This file was generated by the dkct program (see http://dktools.sourceforge.net/ for details). Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: dk4memcpl.ctr */ /** @file dk4memcpl.c The dk4memcpl module. */ #line 52 "dk4memcpl.ctr" #include "dk4conf.h" #if DK4_HAVE_ASSERT_H #ifndef ASSERT_H_INCLUDED #include #define ASSERT_H_INCLUDED 1 #endif #endif #include "dk4memcpl.h" void dk4mem_cpy_to_left(void *dst, const void *src, size_t sz, dk4_er_t *erp) { unsigned char *dptr; const unsigned char *sptr; #if DK4_USE_ASSERT assert(NULL != dst); assert(NULL != src); assert(0 < sz); #endif if ((NULL != dst) && (NULL != src) && (0 < sz)) { dptr = (unsigned char *)dst; sptr = (const unsigned char *)src; while (0 < sz--) { *(dptr++) = *(sptr++); } } else { dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS); } }