Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove strlcpy.

  • Loading branch information...
commit db5ea173d4ff701615bc9abd2b0b23c62cb6dfd6 1 parent 5e3b07c
@ggreer authored
Showing with 1 addition and 32 deletions.
  1. +1 −1  configure.ac
  2. +0 −28 src/util.c
  3. +0 −3  src/util.h
View
2  configure.ac
@@ -20,7 +20,7 @@ AC_CHECK_HEADERS([pthread.h])
AC_CHECK_DECL([PCRE_CONFIG_JIT], [AC_DEFINE([USE_PCRE_JIT], [], [Use PCRE JIT])], [], [#include <pcre.h>])
-AC_CHECK_FUNCS(getline strlcpy strndup)
+AC_CHECK_FUNCS(getline strndup)
AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADERS([src/config.h])
View
28 src/util.c
@@ -223,34 +223,6 @@ int contains_uppercase(const char* s) {
return FALSE;
}
-#ifndef HAVE_STRLCPY
-size_t strlcpy(char *dst, const char *src, size_t siz)
-{
- char *d = dst;
- const char *s = src;
- size_t n = siz;
-
- /* Copy as many bytes as will fit */
- if (n != 0) {
- while (--n != 0) {
- if ((*d++ = *s++) == '\0')
- break;
- }
- }
-
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
-
- while (*s++)
- ;
- }
-
- return (s - src - 1); /* count does not include NUL */
-}
-#endif
-
#ifndef HAVE_GETLINE
/*
* Do it yourself getline() implementation
View
3  src/util.h
@@ -54,9 +54,6 @@ int is_whitespace(const char ch);
int contains_uppercase(const char* s);
-#ifndef HAVE_STRLCPY
-size_t strlcpy(char *dest, const char *src, size_t size);
-#endif
#ifndef HAVE_GETLINE
ssize_t getline(char **lineptr, size_t *n, FILE *stream);
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.