]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tftpd: use `CURLMIN()` macro
authorViktor Szakats <commit@vsz.me>
Thu, 19 Jun 2025 13:24:16 +0000 (15:24 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 19 Jun 2025 13:57:37 +0000 (15:57 +0200)
Closes #17674

tests/server/tftpd.c

index 8c3484b38905d02af1bb6135388f1bbc992c71ee..9fceac28d066851eb9fd17b1fb462d556f1d772e 100644 (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 */