summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marc Horowitz <marc@mit.edu>1990-03-13 13:09:19 +0000
committerGravatar Marc Horowitz <marc@mit.edu>1990-03-13 13:09:19 +0000
commitb94f8a47e9d051715266d0aa6ee703c0213dadd0 (patch)
tree3c3df3774345cf0d63f0a78a1adfc52b1ac30729
parente17949d285c0837db09fdb82da6cccd1b6ca443c (diff)
fixed zwrite to NOT null-terminate the last field of a message
-rw-r--r--clients/zwrite/zwrite.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/clients/zwrite/zwrite.c b/clients/zwrite/zwrite.c
index 5140031..592c924 100644
--- a/clients/zwrite/zwrite.c
+++ b/clients/zwrite/zwrite.c
@@ -271,8 +271,7 @@ main(argc, argv)
}
}
message[msgsize] = '\n';
- message[msgsize+1] = '\0';
- msgsize += 2;
+ msgsize += 1;
} else {
if (isatty(0)) {
for (;;) {
@@ -286,7 +285,6 @@ main(argc, argv)
msgsize += strlen(bfr);
}
message = realloc(message, (unsigned)(msgsize+1));
- message[msgsize++] = '\0';
}
else { /* Use read so you can send binary messages... */
while (nchars = read(fileno(stdin), bfr, sizeof bfr)) {
@@ -300,7 +298,6 @@ main(argc, argv)
}
/* end of msg */
message = realloc(message, (unsigned)(msgsize+1));
- message[msgsize++] = '\0'; /* null-terminate */
}
}