Eliminate two cases of undefined behaviour: total in _fetch_write() was

not initialized before use, and _http_growbuf() did not return a value
on success.

Reported by:	Peter Edwards <pmedwards@eircom.net>
MFC after:	2 weeks
This commit is contained in:
des 2002-10-27 15:43:40 +00:00
parent 2b13c53d76
commit 3b29692357
2 changed files with 2 additions and 0 deletions

View File

@ -465,6 +465,7 @@ _fetch_write(conn_t *conn, const char *buf, size_t len)
timeout.tv_sec += fetchTimeout;
}
total = 0;
while (len > 0) {
while (fetchTimeout && !FD_ISSET(conn->sd, &writefds)) {
FD_SET(conn->sd, &writefds);

View File

@ -179,6 +179,7 @@ _http_growbuf(struct httpio *io, size_t len)
return (-1);
io->buf = tmp;
io->bufsize = len;
return (0);
}
/*