X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=libiberty%2Fstpncpy.c;h=47e0276c7e246fe8d82546d0c660a7e5d8c5a914;hb=23031e319207140e76a9c18e308995fe28322b58;hp=0984340ba2c38f1aca6a20ef310c1ec5af61a902;hpb=10b57b38b38d1308425d0d372884fd1a0fffec06;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/stpncpy.c b/libiberty/stpncpy.c index 0984340ba2..47e0276c7e 100644 --- a/libiberty/stpncpy.c +++ b/libiberty/stpncpy.c @@ -1,5 +1,5 @@ /* Implement the stpncpy function. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003-2019 Free Software Foundation, Inc. Written by Kaveh R. Ghazi . This file is part of the libiberty library. @@ -15,12 +15,13 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* -@deftypefn Supplemental char* stpncpy (char *@var{dst}, const char *@var{src}, size_t @var{len}) +@deftypefn Supplemental char* stpncpy (char *@var{dst}, const char *@var{src}, @ + size_t @var{len}) Copies the string @var{src} into @var{dst}, copying exactly @var{len} and padding with zeros if necessary. If @var{len} < strlen(@var{src}) @@ -32,20 +33,13 @@ strlen(@var{src}). */ #include -#ifdef ANSI_PROTOTYPES #include -#else -#define size_t unsigned long -#endif -extern size_t strlen PARAMS ((const char *)); -extern PTR strncpy PARAMS ((char *, const char *, size_t)); +extern size_t strlen (const char *); +extern char *strncpy (char *, const char *, size_t); char * -stpncpy (dst, src, len) - char *dst; - const char *src; - size_t len; +stpncpy (char *dst, const char *src, size_t len) { size_t n = strlen (src); if (n > len)