links

lynx-like text mode web browser
git clone anongit@rnpnr.xyz:links.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 8e9737a1b59cd76dde5b56cb19343cbddb21e826
Parent: 6368a8f4728abf7452c36b8a05a6b99f243b3fe3
Author: Randy Palamar
Date:   Thu, 26 Aug 2021 17:42:09 -0600

connect.c: properly zero read_buffer and remove useless error check

Diffstat:
Mconnect.c | 2+-
Mhttp.c | 3+--
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/connect.c b/connect.c @@ -780,7 +780,7 @@ struct read_buffer *alloc_read_buffer(void) { struct read_buffer *rb; rb = xmalloc(sizeof(struct read_buffer) + READ_SIZE); - memset(rb, 0, sizeof(struct read_buffer)); + memset(rb, 0, sizeof(struct read_buffer) + READ_SIZE); return rb; } diff --git a/http.c b/http.c @@ -1158,8 +1158,7 @@ static void http_get_header(struct connection *c) { struct read_buffer *rb; set_connection_timeout_keepal(c); - if (!(rb = alloc_read_buffer())) - return; + rb = alloc_read_buffer(); rb->close = 1; read_from_socket(c, c->sock1, rb, http_got_header); }