Fix compiling on MS VS 2022 (64-Bit) without type conversion warnings

This commit is contained in:
Simon Goldschmidt
2026-05-12 21:29:38 +02:00
parent 0c3a93efe3
commit c4d3527a11
5 changed files with 19 additions and 13 deletions

View File

@@ -85,11 +85,11 @@ tftp_close(void* handle)
static int
tftp_read(void* handle, void* buf, int bytes)
{
int ret = fread(buf, 1, bytes, (FILE*)handle);
if (ret <= 0) {
size_t ret = fread(buf, 1, bytes, (FILE*)handle);
if ((ret == 0) || (ret > INT_MAX)) {
return -1;
}
return ret;
return (int)ret;
}
static int