X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=libiberty%2Fspaces.c;h=6e35d2237f84e48bfce85bf71f71636561f4ca41;hb=189b8c2e104017600104457b97315da74a22f549;hp=bfead7ed7a4aebd3bccc2a411e9e0e018cb426be;hpb=ba19b94f67aeec0722939ce17b4067c8fd05f4cc;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/spaces.c b/libiberty/spaces.c index bfead7ed7a..6e35d2237f 100644 --- a/libiberty/spaces.c +++ b/libiberty/spaces.c @@ -1,5 +1,5 @@ /* Allocate memory region filled with spaces. - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991-2019 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or @@ -14,8 +14,8 @@ 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. */ /* @@ -29,6 +29,9 @@ valid until at least the next call. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "ansidecl.h" #include "libiberty.h" @@ -37,13 +40,12 @@ valid until at least the next call. #include #else /* For systems with larger pointers than ints, these must be declared. */ -extern PTR malloc PARAMS ((size_t)); -extern void free PARAMS ((PTR)); +extern PTR malloc (size_t); +extern void free (PTR); #endif const char * -spaces (count) - int count; +spaces (int count) { register char *t; static char *buf; @@ -51,11 +53,8 @@ spaces (count) if (count > maxsize) { - if (buf) - { - free (buf); - } - buf = malloc (count + 1); + free (buf); + buf = (char *) malloc (count + 1); if (buf == (char *) 0) return 0; for (t = buf + count ; t != buf ; )