From a3f56c76444fee090e62a59f257ed5f60b4e552b Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 9 May 2026 02:56:07 +0200 Subject: Add project skeleton --- sdup.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sdup.c (limited to 'sdup.c') diff --git a/sdup.c b/sdup.c new file mode 100644 index 0000000..e990744 --- /dev/null +++ b/sdup.c @@ -0,0 +1,16 @@ +#include "prv.h" +#include +#include +#include + +char *sdup(const char *s) +{ + char *n = malloc(strlen(s) + 1); + + if (n) + strcpy(n, s); + else + perror("malloc(3)"); + + return n; +} -- cgit v1.2.3