Created a CURLMIN macro to match CURLMAX

This commit is contained in:
Dan Fandrich
2009-01-07 19:39:35 +00:00
parent dd058b8de6
commit 80ffd3581f
4 changed files with 7 additions and 21 deletions

View File

@@ -323,10 +323,6 @@ static int data_pending(const struct connectdata *conn)
Curl_ssl_data_pending(conn, FIRSTSOCKET);
}
#ifndef MIN
#define MIN(a,b) (a < b ? a : b)
#endif
static void read_rewind(struct connectdata *conn,
size_t thismuch)
{
@@ -338,7 +334,7 @@ static void read_rewind(struct connectdata *conn,
char buf[512 + 1];
size_t show;
show = MIN(conn->buf_len - conn->read_pos, sizeof(buf)-1);
show = CURLMIN(conn->buf_len - conn->read_pos, sizeof(buf)-1);
if(conn->master_buffer) {
memcpy(buf, conn->master_buffer + conn->read_pos, show);
buf[show] = '\0';