From 6a555fb11396db0babce96ad0a7218929f1af82c Mon Sep 17 00:00:00 2001 From: rodri Date: Tue, 29 Aug 2023 10:48:00 +0000 Subject: removed unnecessary pointer. --- bts.c | 10 ++++------ btsd.c | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/bts.c b/bts.c index 1a8ce29..74a4949 100644 --- a/bts.c +++ b/bts.c @@ -572,7 +572,7 @@ void netrecvthread(void *arg) { Ioproc *io; - char buf[256], *s, *e; + char buf[256], *e; int n, tot, fd; fd = *(int*)arg; @@ -582,13 +582,11 @@ netrecvthread(void *arg) while((n = ioread(io, 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; - processcmd(s); - tot -= e-s; + processcmd(buf); + tot -= e-buf; memmove(buf, e, tot); - s = e; } if(tot >= sizeof(buf)-1) tot = 0; 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; -- cgit v1.2.3