From 2ed8dc12cd5ffbbff9cd25e928a720be3596f2af Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Wed, 10 Nov 2004 19:57:47 +0000 Subject: Clean up the horrible HAVE_[V]SNPRINTF mess, use Trio on systems that lack real snprintf or vsnprintf. svn path=/trunk/; revision=3996 --- report.c | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) (limited to 'report.c') diff --git a/report.c b/report.c index cdded484..cbac88a4 100644 --- a/report.c +++ b/report.c @@ -235,7 +235,6 @@ report_build (FILE *errfp, message, va_alist) #if defined(VA_START) VA_START (args, message); -#if defined(HAVE_VSNPRINTF) || defined(_LIBC) for ( ; ; ) { n = vsnprintf (partial_message + partial_message_size_used, @@ -251,20 +250,8 @@ report_build (FILE *errfp, message, va_alist) partial_message_size += 2048; partial_message = REALLOC (partial_message, partial_message_size); } -#else - vsprintf (partial_message + partial_message_size_used, message, args); - partial_message_size_used += strlen(partial_message+partial_message_size_used); - - /* Attempt to catch memory overwrites... */ - if (partial_message_size_used >= partial_message_size) - { - partial_message_size_used = 0; - report (stderr, GT_("partial error message buffer overflow")); - } -#endif va_end (args); #else -#if HAVE_SNPRINTF for ( ; ; ) { n = snprintf (partial_message + partial_message_size_used, @@ -280,16 +267,6 @@ report_build (FILE *errfp, message, va_alist) partial_message_size += 2048; partial_message = REALLOC (partial_message, partial_message_size); } -#else - sprintf (partial_message + partial_message_size_used, message, a1, a2, a3, a4, a5, a6, a7, a8); - - /* Attempt to catch memory overwrites... */ - if ((partial_message_size_used = strlen (partial_message)) >= partial_message_size) - { - partial_message_size_used = 0; - report (stderr, GT_("partial error message buffer overflow")); - } -#endif #endif if (use_stderr && partial_message_size_used != 0) @@ -335,7 +312,6 @@ report_complete (FILE *errfp, message, va_alist) #if defined(VA_START) VA_START (args, message); -#if defined(HAVE_VSNPRINTF) || defined(_LIBC) for ( ; ; ) { n = vsnprintf (partial_message + partial_message_size_used, @@ -351,20 +327,8 @@ report_complete (FILE *errfp, message, va_alist) partial_message_size += 2048; partial_message = REALLOC (partial_message, partial_message_size); } -#else - vsprintf (partial_message + partial_message_size_used, message, args); - partial_message_size_used += strlen(partial_message+partial_message_size_used); - - /* Attempt to catch memory overwrites... */ - if (partial_message_size_used >= partial_message_size) - { - partial_message_size_used = 0; - report (stderr, GT_("partial error message buffer overflow")); - } -#endif va_end (args); #else -#if HAVE_SNPRINTF for ( ; ; ) { n = snprintf (partial_message + partial_message_size_used, @@ -380,16 +344,6 @@ report_complete (FILE *errfp, message, va_alist) partial_message_size += 2048; partial_message = REALLOC (partial_message, partial_message_size); } -#else - sprintf (partial_message + partial_message_size_used, message, a1, a2, a3, a4, a5, a6, a7, a8); - - /* Attempt to catch memory overwrites... */ - if ((partial_message_size_used = strlen (partial_message)) >= partial_message_size) - { - partial_message_size_used = 0; - report (stderr, GT_("partial error message buffer overflow")); - } -#endif #endif /* Finally... print it. */ -- cgit v1.2.3