aboutsummaryrefslogtreecommitdiff
path: root/btsd.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-08-29 10:48:00 +0000
committerrodri <rgl@antares-labs.eu>2023-08-29 10:48:00 +0000
commit6a555fb11396db0babce96ad0a7218929f1af82c (patch)
tree0498ec01ea9099b92f1fecca89da2ab509a203ae /btsd.c
parentfbea30a51227ccf96382519966f09791b02d0f8e (diff)
downloadbattleship-6a555fb11396db0babce96ad0a7218929f1af82c.tar.gz
battleship-6a555fb11396db0babce96ad0a7218929f1af82c.tar.bz2
battleship-6a555fb11396db0babce96ad0a7218929f1af82c.zip
removed unnecessary pointer.
Diffstat (limited to 'btsd.c')
-rw-r--r--btsd.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/btsd.c b/btsd.c
index 26887d0..b161871 100644
--- a/btsd.c
+++ b/btsd.c
@@ -55,7 +55,7 @@ netrecvthread(void *arg)
{
Chanpipe *cp;
Ioproc *io;
- char buf[256], *s, *e;
+ char buf[256], *e;
int n, tot;
cp = arg;
@@ -65,13 +65,11 @@ netrecvthread(void *arg)
while((n = ioread(io, cp->fd, buf+tot, sizeof(buf)-1-tot)) > 0){
tot += n;
buf[tot] = 0;
- s = buf;
- while((e = strchr(s, '\n')) != nil){
+ while((e = strchr(buf, '\n')) != nil){
*e++ = 0;
- chanprint(cp->c, "%s", s);
- tot -= e-s;
+ chanprint(cp->c, "%s", buf);
+ tot -= e-buf;
memmove(buf, e, tot);
- s = e;
}
if(tot >= sizeof(buf)-1)
tot = 0;