aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-runserver/httpd-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/blogc-runserver/httpd-utils.c')
-rw-r--r--src/blogc-runserver/httpd-utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blogc-runserver/httpd-utils.c b/src/blogc-runserver/httpd-utils.c
index e935668..8d9c024 100644
--- a/src/blogc-runserver/httpd-utils.c
+++ b/src/blogc-runserver/httpd-utils.c
@@ -24,9 +24,9 @@ br_readline(int socket)
char buffer[READLINE_BUFFER_SIZE];
ssize_t len;
- while ((len = read(socket, buffer, READLINE_BUFFER_SIZE)) != -1) {
+ while ((len = read(socket, buffer, READLINE_BUFFER_SIZE)) > 0) {
for (ssize_t i = 0; i < len; i++) {
- if (buffer[i] == '\r' || buffer[i] == '\n')
+ if (buffer[i] == '\r' || buffer[i] == '\n' || buffer[i] == '\0')
goto end;
bc_string_append_c(rv, buffer[i]);
}