Blame src/stpcpy.c

Packit Service 672cf4
/* Copyright (C) 1992, 1995, 1997, 2002, 2004 Free Software Foundation, Inc.
Packit Service 0ef63b
 * This file is part of the GNU C Library.
Packit Service 0ef63b
 *
Packit Service 0ef63b
 * The GNU C Library is free software; you can redistribute it and/or
Packit Service 0ef63b
 * modify it under the terms of the GNU Lesser General Public
Packit Service 0ef63b
 * License as published by the Free Software Foundation; either
Packit Service 0ef63b
 * version 2.1 of the License, or (at your option) any later version.
Packit Service 0ef63b
 *
Packit Service 0ef63b
 * The GNU C Library is distributed in the hope that it will be useful,
Packit Service 0ef63b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 0ef63b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 0ef63b
 * Lesser General Public License for more details.
Packit Service 0ef63b
 *
Packit Service 0ef63b
 * You should have received a copy of the GNU Lesser General Public
Packit Service 0ef63b
 * License along with this program; if not, see <https://gnu.org/licenses/>.
Packit Service 0ef63b
 * SPDX-License-Identifier: LGPL-2.1-or-later
Packit Service 0ef63b
 */
Packit Service 672cf4
Packit Service 672cf4
#ifdef HAVE_CONFIG_H
Packit Service 672cf4
# include <config.h>
Packit Service 672cf4
#endif
Packit Service 672cf4
Packit Service 672cf4
#include <string.h>
Packit Service 672cf4
Packit Service 672cf4
#undef __stpcpy
Packit Service 672cf4
#undef stpcpy
Packit Service 672cf4
Packit Service 672cf4
#ifndef weak_alias
Packit Service 672cf4
# define __stpcpy stpcpy
Packit Service 672cf4
#endif
Packit Service 672cf4
Packit Service 672cf4
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST.  */
Packit Service 672cf4
char *
Packit Service 672cf4
__stpcpy (dest, src)
Packit Service 672cf4
     char *dest;
Packit Service 672cf4
     const char *src;
Packit Service 672cf4
{
Packit Service 672cf4
  register char *d = dest;
Packit Service 672cf4
  register const char *s = src;
Packit Service 672cf4
Packit Service 672cf4
  do
Packit Service 672cf4
    *d++ = *s;
Packit Service 672cf4
  while (*s++ != '\0');
Packit Service 672cf4
Packit Service 672cf4
  return d - 1;
Packit Service 672cf4
}
Packit Service 672cf4
#ifdef libc_hidden_def
Packit Service 672cf4
libc_hidden_def (__stpcpy)
Packit Service 672cf4
#endif
Packit Service 672cf4
#ifdef weak_alias
Packit Service 672cf4
weak_alias (__stpcpy, stpcpy)
Packit Service 672cf4
#endif
Packit Service 672cf4
#ifdef libc_hidden_builtin_def
Packit Service 672cf4
libc_hidden_builtin_def (stpcpy)
Packit Service 672cf4
#endif