aboutsummaryrefslogtreecommitdiff
path: root/src/libeinfo
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-05-05 20:25:53 -0400
committerMike Frysinger <vapier@gentoo.org>2012-05-06 01:17:30 -0400
commit3969cb2a85d798cd029043566d97aad66dcee8e5 (patch)
tree70121111ffa07603876569364638b5a9884afc22 /src/libeinfo
parentb5917a817c697fa284462319357f5fac45c462f0 (diff)
split out librc-independent helpers into a dedicated header file
Many of these helpers are not special to librc, so split them out so they can be used in all source trees (including libeinfo). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'src/libeinfo')
-rw-r--r--src/libeinfo/libeinfo.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c
index 44d4c90f..eb331930 100644
--- a/src/libeinfo/libeinfo.c
+++ b/src/libeinfo/libeinfo.c
@@ -51,6 +51,7 @@ const char libeinfo_copyright[] = "Copyright (c) 2007-2008 Roy Marples";
#include <unistd.h>
#include "einfo.h"
+#include "helpers.h"
#include "hidden-visibility.h"
hidden_proto(ecolor)
@@ -225,27 +226,6 @@ strlcat(char *dst, const char *src, size_t size)
return dst_n + (s - src);
}
-
-static size_t
-strlcpy(char *dst, const char *src, size_t size)
-{
- const char *s = src;
- size_t n = size;
-
- if (n && --n)
- do {
- if (!(*dst++ = *src++))
- break;
- } while (--n);
-
- if (!n) {
- if (size)
- *dst = '\0';
- while (*src++);
- }
-
- return src - s - 1;
-}
# endif
#endif