diff options
author | BurnZeZ <devnull@localhost> | 2018-10-20 18:44:09 +0000 |
---|---|---|
committer | BurnZeZ <devnull@localhost> | 2018-10-20 18:44:09 +0000 |
commit | 84e019aba3dd233d817272cc62ca2a95a5263de7 (patch) | |
tree | 76cef9fdf06fa6d975c357ac55ba63fa4bb7c976 /sys/src/cmd/upas/Mail/reply.c | |
parent | 292cce2ad127d30d29ca2824f7dd484620256ceb (diff) |
fix misleading/wrong fd checks
Diffstat (limited to 'sys/src/cmd/upas/Mail/reply.c')
-rw-r--r-- | sys/src/cmd/upas/Mail/reply.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/src/cmd/upas/Mail/reply.c b/sys/src/cmd/upas/Mail/reply.c index 0a5edf46c..167a64bd5 100644 --- a/sys/src/cmd/upas/Mail/reply.c +++ b/sys/src/cmd/upas/Mail/reply.c @@ -336,7 +336,7 @@ print2(int fd, int ofd, char *fmt, ...) return -1; m = strlen(s); n = write(fd, s, m); - if(ofd > 0) + if(ofd >= 0) write(ofd, s, m); return n; } @@ -350,7 +350,7 @@ write2(int fd, int ofd, char *buf, int n, int nofrom) if(fd >= 0) m = write(fd, buf, n); - if(ofd <= 0) + if(ofd < 0) return m; if(nofrom == 0) @@ -463,7 +463,7 @@ mesgsend(Message *m) } ofd = open(outgoing, OWRITE|OCEXEC); /* no error check necessary */ - if(ofd > 0){ + if(ofd >= 0){ /* From dhog Fri Aug 24 22:13:00 EDT 2001 */ now = ctime(time(0)); fprint(ofd, "From %s %s", user, now); @@ -537,14 +537,14 @@ mesgsend(Message *m) write2(p[1], ofd, "\n", 1, 0); /* these look like pseudo-attachments in the "outgoing" box */ - if(ofd>0 && natt>0){ + if(ofd>=0 && natt>0){ for(i=0; i<natt; i++) if(included[i]) fprint(ofd, "=====> Include: %s\n", attlist[i]); else fprint(ofd, "=====> Attach: %s\n", attlist[i]); } - if(ofd > 0) + if(ofd >= 0) write(ofd, "\n", 1); for(i=0; i<natt; i++) |