You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2015/01/09 15:57:52 UTC

[2/3] trafficserver git commit: TS-3284 Remove ink_strncpy() and ink_strlcpy()

TS-3284 Remove ink_strncpy() and ink_strlcpy()


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/fc4bce1e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/fc4bce1e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/fc4bce1e

Branch: refs/heads/master
Commit: fc4bce1e9aad461b82f54ef33399c5a465551221
Parents: a1a30aa
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jan 9 07:42:54 2015 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jan 9 07:42:54 2015 -0700

----------------------------------------------------------------------
 lib/ts/ink_string.cc | 48 -----------------------------------------------
 lib/ts/ink_string.h  |  2 --
 2 files changed, 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fc4bce1e/lib/ts/ink_string.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.cc b/lib/ts/ink_string.cc
index 3307381..c079b5e 100644
--- a/lib/ts/ink_string.cc
+++ b/lib/ts/ink_string.cc
@@ -43,54 +43,6 @@ ink_memcpy_until_char(char *dst, char *src, unsigned int n, unsigned char c)
 
 /*---------------------------------------------------------------------------*
 
-  char *ink_strncpy(char *dest, char *src, int n)
-
-  This routine is a safer version of strncpy which always NUL terminates
-  the destination string.  Note that this routine has the SAME semantics
-  as strncpy, such as copying exactly n bytes, padding dest with NULs
-  is necessary.  Use ink_string_copy for a non-padding version.
-
- *---------------------------------------------------------------------------*/
-
-char *
-ink_strncpy(char *dest, const char *src, int n)
-{
-  if (likely(src && dest)) {
-    if (n > 1)
-      strncpy(dest, src, (n - 1));
-    if (n > 0)
-      dest[n - 1] = '\0';
-  }
-
-  return (dest);
-}                               /* End ink_strncpy */
-
-/*---------------------------------------------------------------------------*
-
-  char *ink_strncat(char *dest, char *src, int n)
-
-  This routine is a safer version of strncat which always NUL terminates
-  the destination string.  Note that this routine has the SAME semantics
-  as strncat, such as concatinating exactly n bytes, padding dest with NULs
-  is necessary.  Use ink_string_copy for a non-padding version.
-
- *---------------------------------------------------------------------------*/
-
-char *
-ink_strncat(char *dest, const char *src, int n)
-{
-  if (likely(src && dest)) {
-    if (n > 1)
-      strncat(dest, src, (n - 1));
-    if (n > 0)
-      dest[n - 1] = '\0';
-  }
-
-  return (dest);
-}                               /* End ink_strncat */
-
-/*---------------------------------------------------------------------------*
-
   char *ink_string_concatenate_strings(char *dest, ...)
 
   This routine concatenates a variable number of strings into the buffer

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fc4bce1e/lib/ts/ink_string.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.h b/lib/ts/ink_string.h
index 7048ada..a822cc5 100644
--- a/lib/ts/ink_string.h
+++ b/lib/ts/ink_string.h
@@ -50,8 +50,6 @@
 /* these are supposed to be fast */
 
 inkcoreapi char *ink_memcpy_until_char(char *dst, char *src, unsigned int n, unsigned char c);
-inkcoreapi char *ink_strncpy(char *dest, const char *src, int n);
-inkcoreapi char *ink_strncat(char *dest, const char *src, int n);
 inkcoreapi char *ink_string_concatenate_strings(char *dest, ...);
 inkcoreapi char *ink_string_concatenate_strings_n(char *dest, int n, ...);
 inkcoreapi char *ink_string_append(char *dest, char *src, int n);