From 3969cb2a85d798cd029043566d97aad66dcee8e5 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 5 May 2012 20:25:53 -0400 Subject: 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 --- src/libeinfo/libeinfo.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'src/libeinfo/libeinfo.c') 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 #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 -- cgit v1.2.3