Path: blob/main/system/lib/llvm-libc/src/string/strcpy.cpp
6175 views
//===-- Implementation of strcpy ------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "src/string/strcpy.h"9#include "src/__support/macros/config.h"10#include "src/__support/macros/null_check.h"11#include "src/string/memory_utils/inline_memcpy.h"12#include "src/string/string_utils.h"1314#include "src/__support/common.h"1516namespace LIBC_NAMESPACE_DECL {1718LLVM_LIBC_FUNCTION(char *, strcpy,19(char *__restrict dest, const char *__restrict src)) {20LIBC_CRASH_ON_NULLPTR(dest);21size_t size = internal::string_length(src) + 1;22inline_memcpy(dest, src, size);23return dest;24}2526} // namespace LIBC_NAMESPACE_DECL272829