118bd4294f
* This is required because some old libraries still rely on the strncpy16() function. Change-Id: I77da329d1296d946f43ffe6708444b1d25607342
22 lines
377 B
C++
22 lines
377 B
C++
/*
|
|
* Copyright (C) 2023 The LineageOS Project
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
|
|
extern "C" {
|
|
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;
|
|
}
|
|
}
|