Path: blob/main/system/lib/llvm-libc/src/string/stpcpy.cpp
6175 views
//===-- Implementation of stpcpy ------------------------------------------===//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/stpcpy.h"9#include "src/__support/macros/config.h"10#include "src/string/string_utils.h"1112#include "src/__support/common.h"1314namespace LIBC_NAMESPACE_DECL {1516LLVM_LIBC_FUNCTION(char *, stpcpy,17(char *__restrict dest, const char *__restrict src)) {18size_t size = internal::string_length(src) + 1;19__builtin_memcpy(dest, src, size);20char *result = dest + size;2122if (result != nullptr)23return result - 1;24return nullptr;25}2627} // namespace LIBC_NAMESPACE_DECL282930