/* 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: dk4strda.ctr */ /** @file dk4strda.c The dk4strda module. */ #line 63 "dk4strda.ctr" #include "dk4conf.h" #include "dk4strda.h" #ifndef DK4NUMCO_H_INCLUDED #include "dk4numco.h" #endif #ifndef DK4MEMA_H_INCLUDED #include "dk4mema.h" #endif #ifndef DK4STRD_H_INCLUDED #include "dk4strd.h" #endif #ifndef DK4CONST_H_INCLUDED #include "dk4const.h" #endif #if DK4_HAVE_ASSERT_H #ifndef ASSERT_H_INCLUDED #include #define ASSERT_H_INCLUDED 1 #endif #endif #line 92 "dk4strda.ctr" dkChar * dk4str_dup_app(const dkChar *src, dk4_app_t *app) { dkChar *back = NULL; size_t sz; #if DK4_USE_ASSERT assert(NULL != src); #endif if (NULL != src) { sz = dk4str_len(src); if (SIZE_MAX > sz) { sz++; back = dk4mem_new_app(dkChar,sz,app); if (NULL != back) { (void)dk4str_cpy_s(back, sz, src, NULL); #if 0 if (NULL != app) { if (0 != dk4app_log_do(app, DK4_LL_DEBUG)) { if ((NULL != app->msg_debug) && (41 < app->sz_msg_debug)) { dk4app_log_3( app,app->msg_debug,app->sz_msg_debug,DK4_LL_DEBUG,40,41,back ); } } } #endif } } else { dk4app_log_base1(app, DK4_LL_ERROR, 82); } } return back; }