tftpd: use CURLMIN() macro

Closes #17674
This commit is contained in:
Viktor Szakats 2025-06-19 15:24:16 +02:00
parent 916f241f2f
commit 6c1a7541fb
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -179,9 +179,6 @@ struct bf {
#define TIMEOUT 5
#undef MIN
#define MIN(x,y) ((x)<(y)?(x):(y))
#define REQUEST_DUMP "server.input"
/*****************************************************************************
@ -392,7 +389,7 @@ static void read_ahead(struct testcase *test,
if(convert == 0) {
/* The former file reading code did this:
b->counter = read(fileno(file), dp->th_data, SEGSIZE); */
size_t copy_n = MIN(SEGSIZE, test->rcount);
size_t copy_n = CURLMIN(SEGSIZE, test->rcount);
memcpy(dp->th_data, test->rptr, copy_n);
/* decrease amount, advance pointer */