PR29482 - strip: heap-buffer-overflow
[binutils-gdb.git] / libiberty / vsprintf.c
index bf0760cf6d38bb43dd07906b197153cd78103272..cdbebdffd8eabf9fbbefd0180583814e85f4c503 100644 (file)
@@ -3,7 +3,7 @@
    implementations of stdio; newer ones should already have vsprintf.
    Written by Per Bothner of Cygnus Support.
    Based on libg++'s "form" (written by Doug Lea; dl@rocky.oswego.edu).
-   Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1991-2022 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.  This library is free
 software; you can redistribute it and/or modify it under the
@@ -18,7 +18,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 
 As a special exception, if you link this library with files
 compiled with a GNU compiler to produce an executable, this does not cause
@@ -26,16 +26,15 @@ the resulting executable to be covered by the GNU General Public License.
 This exception does not however invalidate any other reasons why
 the executable file might be covered by the GNU General Public License. */
 
-#include <varargs.h>
-#include <stdio.h>
 #include <ansidecl.h>
+#include <stdarg.h>
+#include <stdio.h>
 #undef vsprintf
 
+#if defined _IOSTRG && defined _IOWRT
+
 int
-vsprintf (buf, format, ap)
-     char *buf;
-     const char *format;
-     va_list ap;
+vsprintf (char *buf, const char *format, va_list ap)
 {
   FILE b;
   int ret;
@@ -53,3 +52,5 @@ vsprintf (buf, format, ap)
   return ret;
 
 }
+
+#endif