aboutsummaryrefslogtreecommitdiffstats
path: root/report.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2006-03-14 09:10:20 +0000
committerMatthias Andree <matthias.andree@gmx.de>2006-03-14 09:10:20 +0000
commit9dc0b8bd674f71f8ee422b037dc409f2dd4f9487 (patch)
tree32e04cf0045782e10fc3eecc8fa82101b3fb94ec /report.c
parent20a0097f74bfdec16c17dd7d3eb5968f81ec90c1 (diff)
downloadfetchmail-9dc0b8bd674f71f8ee422b037dc409f2dd4f9487.tar.gz
fetchmail-9dc0b8bd674f71f8ee422b037dc409f2dd4f9487.tar.bz2
fetchmail-9dc0b8bd674f71f8ee422b037dc409f2dd4f9487.zip
merge Mirek's fetchmail-signed.patch
svn path=/branches/BRANCH_6-3/; revision=4734
Diffstat (limited to 'report.c')
-rw-r--r--report.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/report.c b/report.c
index 969395be..31d4e482 100644
--- a/report.c
+++ b/report.c
@@ -241,11 +241,11 @@ report_build (FILE *errfp, message, va_alist)
VA_START (args, message);
for ( ; ; )
{
- n = vsnprintf (partial_message + partial_message_size_used,
- partial_message_size - partial_message_size_used,
+ n = vsnprintf (partial_message + partial_message_size_used, partial_message_size - partial_message_size_used,
message, args);
- if (n < partial_message_size - partial_message_size_used)
+ if (n >= 0
+ && (unsigned)n < partial_message_size - partial_message_size_used)
{
partial_message_size_used += n;
break;
@@ -262,7 +262,8 @@ report_build (FILE *errfp, message, va_alist)
partial_message_size - partial_message_size_used,
message, a1, a2, a3, a4, a5, a6, a7, a8);
- if (n < partial_message_size - partial_message_size_used)
+ if (n >= 0
+ && (unsigned)n < partial_message_size - partial_message_size_used)
{
partial_message_size_used += n;
break;
@@ -310,7 +311,9 @@ report_complete (FILE *errfp, message, va_alist)
partial_message_size - partial_message_size_used,
message, args);
- if (n < partial_message_size - partial_message_size_used)
+ /* old glibc versions return -1 for truncation */
+ if (n >= 0
+ && (unsigned)n < partial_message_size - partial_message_size_used)
{
partial_message_size_used += n;
break;
@@ -327,7 +330,8 @@ report_complete (FILE *errfp, message, va_alist)
partial_message_size - partial_message_size_used,
message, a1, a2, a3, a4, a5, a6, a7, a8);
- if (n < partial_message_size - partial_message_size_used)
+ if (n >= 0
+ && (unsigned)n < partial_message_size - partial_message_size_used)
{
partial_message_size_used += n;
break;