Blame src/stpcpy.c

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