aboutsummaryrefslogtreecommitdiffstats
path: root/report.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-02-18 03:57:19 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-02-18 03:57:19 +0000
commite70d6db9a9513c6e2040f118264b1dd606ca5fe6 (patch)
tree3f0c631bae6e5b01903c5b006fe43dc2ab59192e /report.c
parent87e5598795b289a87f80ff147bebb6753c9ff73e (diff)
downloadfetchmail-e70d6db9a9513c6e2040f118264b1dd606ca5fe6.tar.gz
fetchmail-e70d6db9a9513c6e2040f118264b1dd606ca5fe6.tar.bz2
fetchmail-e70d6db9a9513c6e2040f118264b1dd606ca5fe6.zip
Dave Bodenstab's error-message corrections.
svn path=/trunk/; revision=900
Diffstat (limited to 'report.c')
-rw-r--r--report.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/report.c b/report.c
index f6fbd765..174abeb9 100644
--- a/report.c
+++ b/report.c
@@ -315,8 +315,7 @@ error_build (message, va_alist)
partial_message = xrealloc (partial_message, partial_message_size);
}
#else
- VA_START (args, message);
- vsprintf (partial_message + partial_message_size_used, message, args);
+ 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)
@@ -324,7 +323,6 @@ error_build (message, va_alist)
partial_message_size_used = 0;
error (PS_UNDEFINED, 0, "partial error message buffer overflow");
}
- va_end (args);
#endif
#endif
@@ -407,8 +405,7 @@ error_complete (status, errnum, message, va_alist)
partial_message = xrealloc (partial_message, partial_message_size);
}
#else
- VA_START (args, message);
- vsprintf (partial_message + partial_message_size_used, message, args);
+ 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)
@@ -416,28 +413,29 @@ error_complete (status, errnum, message, va_alist)
partial_message_size_used = 0;
error (PS_UNDEFINED, 0, "partial error message buffer overflow");
}
- va_end (args);
#endif
#endif
/* Finally... print it. */
- if (partial_message_size_used != 0)
+ partial_message_size_used = 0;
+
+ if (use_stderr)
{
- partial_message_size_used = 0;
- if (use_stderr)
- {
- fputs(partial_message, stderr);
- if (errnum)
- fprintf (stderr, ": %s", strerror (errnum));
- putc ('\n', stderr);
- fflush (stderr);
- ++error_message_count;
- if (status)
- exit(status);
- }
- else
- error (status, errnum, "%s", partial_message);
+ fputs(partial_message, stderr);
+
+ if (errnum)
+ fprintf (stderr, ": %s", strerror (errnum));
+
+ putc ('\n', stderr);
+ fflush (stderr);
+
+ ++error_message_count;
+
+ if (status)
+ exit(status);
}
+ else
+ error (status, errnum, "%s", partial_message);
}
/* Sometimes we want to have at most one error per line. This