aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-09-09 13:43:55 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-09-09 13:43:55 +0000
commit91341f7be66f2865fe4000dae05dd78f448b3ca6 (patch)
tree23ca050519a599578303e560be32a2a2d1ff8638 /sink.c
parentdc688e8c7f7165d0019a56c0079df651d704664b (diff)
downloadfetchmail-91341f7be66f2865fe4000dae05dd78f448b3ca6.tar.gz
fetchmail-91341f7be66f2865fe4000dae05dd78f448b3ca6.tar.bz2
fetchmail-91341f7be66f2865fe4000dae05dd78f448b3ca6.zip
Sunil Shetye's latest fix patch.
svn path=/trunk/; revision=3707
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sink.c b/sink.c
index 51b4cf12..8d487b6c 100644
--- a/sink.c
+++ b/sink.c
@@ -694,6 +694,7 @@ static const char *is_quad(const char *q)
return NULL;
/* Make sure quad is < 255 */
if ( (r-q) == 3)
+ {
if (*q > '2')
return NULL;
else if (*q == '2')
@@ -706,6 +707,7 @@ static const char *is_quad(const char *q)
return NULL;
}
}
+ }
return r;
}
@@ -1206,7 +1208,13 @@ void release_sink(struct query *ctl)
/* release the per-message output sink, whether it's a pipe or SMTP socket */
{
if (ctl->bsmtp && sinkfp)
- fclose(sinkfp);
+ {
+ if (strcmp(ctl->bsmtp, "-"))
+ {
+ fclose(sinkfp);
+ sinkfp = (FILE *)NULL;
+ }
+ }
else if (ctl->mda)
{
if (sinkfp)
@@ -1251,7 +1259,10 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward)
fputs(".\r\n", sinkfp);
error = ferror(sinkfp);
if (strcmp(ctl->bsmtp, "-"))
+ {
if (fclose(sinkfp) == EOF) error = 1;
+ sinkfp = (FILE *)NULL;
+ }
if (error)
{
report(stderr,