summaryrefslogtreecommitdiffstats
path: root/contrib/argp-standalone/strndup.c
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2018-07-27 08:45:48 +0000
committerNiels de Vos <ndevos@redhat.com>2018-07-28 12:54:33 +0000
commit379d4279601f694465cc7eaffcb737410d5d9e31 (patch)
tree47be48bf3fecb31ee9aa6fbd1ea9442af90e8584 /contrib/argp-standalone/strndup.c
parent7131de81f72dda0ef685ed60d0887c6e14289b8c (diff)
build: remove bundled arg-standalone
libargp or argp-standalone is available on all commonly used distributions. There is no need to bundle an unmaintained version of argp-standalone in this repository anymore. FreeBSD places the argp.h file in /usr/local/include when argp-standalone is installed. This path is not added to CPPFLAGS by default, so thats done in configure.ac as well. Change-Id: I384a53ab0a008ec9d48fd83afeaf8fbc197e91ee Fixes: bz#1609337 Signed-off-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'contrib/argp-standalone/strndup.c')
-rw-r--r--contrib/argp-standalone/strndup.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/contrib/argp-standalone/strndup.c b/contrib/argp-standalone/strndup.c
deleted file mode 100644
index 4147b7a2051..00000000000
--- a/contrib/argp-standalone/strndup.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* strndup.c
- *
- */
-
-/* Written by Niels Möller <nisse@lysator.liu.se>
- *
- * This file is hereby placed in the public domain.
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-char *
-strndup (const char *, size_t);
-
-char *
-strndup (const char *s, size_t size)
-{
- char *r;
- char *end = memchr(s, 0, size);
-
- if (end)
- /* Length + 1 */
- size = end - s + 1;
-
- r = malloc(size);
-
- if (size)
- {
- memcpy(r, s, size-1);
- r[size-1] = '\0';
- }
- return r;
-}