From 930b92a2683095f50670b6335c2a15837164ee6f Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Mon, 6 May 2013 07:32:02 -0400 Subject: [PATCH] Remove strlc(at|py). --- ncmlib/strl.c | 33 ++------------------------------- ncmlib/strl.h | 13 ++----------- 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/ncmlib/strl.c b/ncmlib/strl.c index 324bb17..a23211e 100644 --- a/ncmlib/strl.c +++ b/ncmlib/strl.c @@ -1,7 +1,6 @@ -/* strl.c - strlcpy/strlcat implementation - * Time-stamp: <2010-11-03 05:25:02 njk> +/* strl.c - strnkcpy/strnkcat implementation * - * (c) 2003-2010 Nicholas J. Kain + * (c) 2003-2013 Nicholas J. Kain * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -51,31 +50,3 @@ bool strnkcat (char *dest, const char *src, size_t size) return strnkcpy(dest, src, size); } -#ifndef HAVE_STRLCPY -size_t strlcpy (char *dest, const char *src, size_t size) -{ - register unsigned int i = 0; - - if (size > 0) { - size--; - for (i=0; size > 0 && src[i] != '\0'; ++i, size--) - dest[i] = src[i]; - - dest[i] = '\0'; - } - while (src[i++]); - - return i; -} -#endif /* HAVE_STRLCPY */ - -#ifndef HAVE_STRLCAT -size_t strlcat (char *dest, const char *src, size_t size) -{ - register char *d = dest; - - for (; size > 0 && *d != '\0'; size--, d++); - return (d - dest) + strlcpy(d, src, size); -} -#endif /* HAVE_STRLCAT */ - diff --git a/ncmlib/strl.h b/ncmlib/strl.h index b199433..deea5e8 100644 --- a/ncmlib/strl.h +++ b/ncmlib/strl.h @@ -1,7 +1,6 @@ -/* strl.h - header file for strlcpy/strlcat implementation - * Time-stamp: <2010-11-03 05:24:52 njk> +/* strl.h - strnkcpy/strnkcat implementation * - * (c) 2003-2010 Nicholas J. Kain + * (c) 2003-2013 Nicholas J. Kain * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,13 +34,5 @@ bool strnkcpy (char *dest, const char *src, size_t size); bool strnkcat (char *dest, const char *src, size_t size); -#ifndef HAVE_STRLCPY -size_t strlcpy (char *dest, const char *src, size_t size); -#endif /* HAVE_STRLCPY */ - -#ifndef HAVE_STRLCAT -size_t strlcat (char *dest, const char *src, size_t size); -#endif /* HAVE_STRLCAT */ - #endif