Blame src/stpcpy.c

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