summaryrefslogtreecommitdiff
path: root/src/strops.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-08-09 08:33:08 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-08-09 08:33:08 +0200
commit5d34aff5888d3f0c624251f15bedb96c347978d6 (patch)
tree69a49651271d645ca7eaa114cb1830bf759c0930 /src/strops.cpp
parentb94a7ae06b20d550c727d5192cea8baf3e8fb641 (diff)
refactors
Diffstat (limited to 'src/strops.cpp')
-rw-r--r--src/strops.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/strops.cpp b/src/strops.cpp
new file mode 100644
index 0000000..42042cb
--- /dev/null
+++ b/src/strops.cpp
@@ -0,0 +1,18 @@
+#include <string.h>
+
+#include "strops.hpp"
+
+size_t strops_copy(char *dst, const char *src, size_t size)
+{
+ size_t srclen;
+ size --;
+ srclen = strlen(src);
+
+ if (srclen > size)
+ srclen = size;
+
+ memcpy(dst, src, srclen);
+ dst[srclen] = '\0';
+
+ return (srclen);
+} \ No newline at end of file