From d2962c8a151115111f375145ddda2bd7ddb4043d Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 24 Jan 2019 13:07:18 -0800 Subject: [PATCH] Remove dead code. If this was strlcpy16 it wouldn't be such a bad idea, but strncpy16 is just an accident waiting to happen... Test: N/A Change-Id: Id296fdeadfb9f1f70ddc8fb6d31b3b6b5178a12c --- libutils/Unicode.cpp | 19 ------------------- libutils/include/utils/Unicode.h | 1 - 2 files changed, 20 deletions(-) diff --git a/libutils/Unicode.cpp b/libutils/Unicode.cpp index 5f0a51f1c..24a745ac5 100644 --- a/libutils/Unicode.cpp +++ b/libutils/Unicode.cpp @@ -275,25 +275,6 @@ size_t strlen16(const char16_t *s) return ss-s; } - -char16_t *strncpy16(char16_t *dst, const char16_t *src, size_t n) -{ - char16_t *q = dst; - const char16_t *p = src; - char ch; - - while (n) { - n--; - *q++ = ch = *p++; - if ( !ch ) - break; - } - - *q = 0; - - return dst; -} - size_t strnlen16(const char16_t *s, size_t maxlen) { const char16_t *ss = s; diff --git a/libutils/include/utils/Unicode.h b/libutils/include/utils/Unicode.h index 61a1b4fcf..a2aaa47ae 100644 --- a/libutils/include/utils/Unicode.h +++ b/libutils/include/utils/Unicode.h @@ -28,7 +28,6 @@ int strncmp16(const char16_t *s1, const char16_t *s2, size_t n); size_t strlen16(const char16_t *); size_t strnlen16(const char16_t *, size_t); char16_t *strcpy16(char16_t *, const char16_t *); -char16_t *strncpy16(char16_t *, const char16_t *, size_t); char16_t *strstr16(const char16_t*, const char16_t*); // Version of comparison that supports embedded NULs.