Blame src/stpcpy.c

Packit d7e8d0
/* Copyright (C) 1992, 1995, 1997, 2002, 2004 Free Software Foundation, Inc.
Packit d7e8d0
   This file is part of the GNU C Library.
Packit d7e8d0
Packit d7e8d0
   The GNU C Library is free software; you can redistribute it and/or
Packit d7e8d0
   modify it under the terms of the GNU Lesser General Public
Packit d7e8d0
   License as published by the Free Software Foundation; either
Packit d7e8d0
   version 2.1 of the License, or (at your option) any later version.
Packit d7e8d0
Packit d7e8d0
   The GNU C Library is distributed in the hope that it will be useful,
Packit d7e8d0
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit d7e8d0
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit d7e8d0
   Lesser General Public License for more details.
Packit d7e8d0
Packit d7e8d0
   You should have received a copy of the GNU Lesser General Public
Packit d7e8d0
   License along with the GNU C Library; if not, write to the Free
Packit d7e8d0
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
Packit d7e8d0
   02111-1307 USA.  */
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