platform_hardware_tequila_c.../libutils/String16.cpp
R0rt1z2 118bd4294f
compat: Add libutils shim
* This is required because some old libraries still rely on the
  strncpy16() function.

Change-Id: I77da329d1296d946f43ffe6708444b1d25607342
2023-07-19 21:32:21 +02:00

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;
}
}