From 22f7a6c7df95e4188c8076e417be9421c5661a34 Mon Sep 17 00:00:00 2001 From: okada Date: Thu, 2 Nov 2000 10:02:28 +0000 Subject: [PATCH] 2000-10-07 Simon Josefsson * starttls.c: Use `sizeof buffer -1' instead of `BUFSIZ/2'. --- ChangeLog | 4 ++++ starttls.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44ad9e5..1b4611a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-10-07 Simon Josefsson + + * starttls.c: Use `sizeof buffer -1' instead of `BUFSIZ/2'. + 2000-10-07 Daiki Ueno * .cvsignore: Add `aclocal.m4', `install-sh', `mkinstalldirs', diff --git a/starttls.c b/starttls.c index 778ab48..db74ed2 100644 --- a/starttls.c +++ b/starttls.c @@ -310,7 +310,7 @@ main (argc, argv) } if (FD_ISSET (in, &readfds)) { - nbuffer = read (in, buffer, BUFSIZ/2); + nbuffer = read (in, buffer, sizeof buffer -1); if (nbuffer == 0) goto finish; @@ -332,9 +332,9 @@ main (argc, argv) if (FD_ISSET (tls_fd, &readfds)) { if (tls_conn) - nbuffer = SSL_read (tls_conn, buffer, BUFSIZ/8); + nbuffer = SSL_read (tls_conn, buffer, sizeof buffer -1); else - nbuffer = read (tls_fd, buffer, BUFSIZ/2); + nbuffer = read (tls_fd, buffer, sizeof buffer -1); if (nbuffer == 0) goto finish; for (retry = buffer; nbuffer > 0; nbuffer -= wrote, retry += wrote) -- 1.7.10.4