From a9bfff94add1508b7ffd9b4541ef9fa74e3de88d Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 21 Jul 2005 08:03:54 +0000 Subject: [PATCH] Use vsnprintf instead of vsprintf. --- gas/ChangeLog | 4 ++++ gas/messages.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 3cac97bee8e..a81af539868 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2005-07-20 Tavis Ormandy + + * messages.c: Use vsnprintf instead of vsprintf. + 2005-07-20 Kazuhiro Inaoka * config/tc-m32r.c (tc_gen_reloc): Check BFD_RELOC_32_PCREL and diff --git a/gas/messages.c b/gas/messages.c index a2d7d1ddfe5..8ce6bc763cb 100644 --- a/gas/messages.c +++ b/gas/messages.c @@ -233,7 +233,7 @@ as_warn (const char *format, ...) if (!flag_no_warnings) { va_start (args, format); - vsprintf (buffer, format, args); + vsnprintf (buffer, sizeof (buffer), format, args); va_end (args); as_warn_internal ((char *) NULL, 0, buffer); } @@ -250,7 +250,7 @@ as_warn (format, va_alist) if (!flag_no_warnings) { va_start (args); - vsprintf (buffer, format, args); + vsnprintf (buffer, sizeof (buffer), format, args); va_end (args); as_warn_internal ((char *) NULL, 0, buffer); } @@ -271,7 +271,7 @@ as_warn_where (char *file, unsigned int line, const char *format, ...) if (!flag_no_warnings) { va_start (args, format); - vsprintf (buffer, format, args); + vsnprintf (buffer, sizeof (buffer), format, args); va_end (args); as_warn_internal (file, line, buffer); } @@ -290,7 +290,7 @@ as_warn_where (file, line, format, va_alist) if (!flag_no_warnings) { va_start (args); - vsprintf (buffer, format, args); + vsnprintf (buffer, sizeof (buffer), format, args); va_end (args); as_warn_internal (file, line, buffer); } @@ -332,7 +332,7 @@ as_bad (const char *format, ...) char buffer[2000]; va_start (args, format); - vsprintf (buffer, format, args); + vsnprintf (buffer, sizeof (buffer), format, args); va_end (args); as_bad_internal ((char *) NULL, 0, buffer); @@ -348,7 +348,7 @@ as_bad (format, va_alist) char buffer[2000]; va_start (args); - vsprintf (buffer, format, args); + vsnprintf (buffer, sizeof (buffer), format, args); va_end (args); as_bad_internal ((char *) NULL, 0, buffer); @@ -367,7 +367,7 @@ as_bad_where (char *file, unsigned int line, const char *format, ...) char buffer[2000]; va_start (args, format); - vsprintf (buffer, format, args); + vsnprintf (buffer, sizeof (buffer), format, args); va_end (args); as_bad_internal (file, line, buffer); @@ -385,7 +385,7 @@ as_bad_where (file, line, format, va_alist) char buffer[2000]; va_start (args); - vsprintf (buffer, format, args); + vsnprintf (buffer, sizeof (buffer), format, args); va_end (args); as_bad_internal (file, line, buffer); -- 2.30.2