From ffd41ceab7ba8ecd51be725017cb85b742c9ca29 Mon Sep 17 00:00:00 2001 From: Nate Choe Date: Sun, 30 Jan 2022 18:02:25 -0600 Subject: [PATCH] Minor bugfixes --- Makefile | 4 ++-- src/connections.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 191680b..d3eb60f 100644 --- a/Makefile +++ b/Makefile @@ -13,9 +13,9 @@ work/%.o: src/%.c $(wildcard src/include/*.h) $(CC) $(CFLAGS) $< -c -o $@ install: build/$(OUT) - useradd -M swebs cp build/$(OUT) $(INSTALLDIR)/$(OUT) + useradd -M swebs uninstall: $(INSTALLDIR)/$(OUT) - userdel swebs rm $(INSTALLDIR)/$(OUT) + userdel swebs diff --git a/src/connections.c b/src/connections.c index 65aabaf..29ab843 100644 --- a/src/connections.c +++ b/src/connections.c @@ -205,6 +205,8 @@ static int processChar(Connection *conn, char c, Sitefile *site) { size_t readLen = read(conn->fd, buffer, sizeof(buffer)); if (readLen == 0) break; + if (readLen < 0) + return 1; size_t writeLen = sendStream(conn->stream, buffer, readLen); if (writeLen < readLen)