Blame gnulib/lib/stpcpy.c
|
Packit Service |
a2ae7a |
/* stpcpy.c -- copy a string and return pointer to end of new string
|
|
Packit Service |
a2ae7a |
Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2019 Free Software
|
|
Packit Service |
a2ae7a |
Foundation, Inc.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
|
Packit Service |
a2ae7a |
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
This program is free software: you can redistribute it and/or modify it
|
|
Packit Service |
a2ae7a |
under the terms of the GNU Lesser General Public License as published by the
|
|
Packit Service |
a2ae7a |
Free Software Foundation; either version 2.1 of the License, or any
|
|
Packit Service |
a2ae7a |
later version.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
This program is distributed in the hope that it will be useful,
|
|
Packit Service |
a2ae7a |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
a2ae7a |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
a2ae7a |
GNU Lesser General Public License for more details.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
You should have received a copy of the GNU Lesser General Public License
|
|
Packit Service |
a2ae7a |
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#include <config.h>
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#include <string.h>
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#undef __stpcpy
|
|
Packit Service |
a2ae7a |
#ifdef _LIBC
|
|
Packit Service |
a2ae7a |
# undef stpcpy
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#ifndef weak_alias
|
|
Packit Service |
a2ae7a |
# define __stpcpy stpcpy
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
|
|
Packit Service |
a2ae7a |
char *
|
|
Packit Service |
a2ae7a |
__stpcpy (char *dest, const char *src)
|
|
Packit Service |
a2ae7a |
{
|
|
Packit Service |
a2ae7a |
register char *d = dest;
|
|
Packit Service |
a2ae7a |
register const char *s = src;
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
do
|
|
Packit Service |
a2ae7a |
*d++ = *s;
|
|
Packit Service |
a2ae7a |
while (*s++ != '\0');
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
return d - 1;
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
#ifdef weak_alias
|
|
Packit Service |
a2ae7a |
weak_alias (__stpcpy, stpcpy)
|
|
Packit Service |
a2ae7a |
#endif
|