Blame src/stpcpy.c

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