Skip to content

Commit 0ea8f93

Browse files
committed
Fix double blunder
- Make sure to use the right platform-specific variable in both cases - Can't use filesize_to_str() more than once due to its static buffer
1 parent 097d889 commit 0ea8f93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ int freadMain(freadMainArgs _args) {
14231423
}
14241424
if (stat_buf.st_size > SIZE_MAX) {
14251425
close(fd); // # nocov
1426-
STOP(_("File is too large [%s > %s]: %s"), filesize_to_str(stat_buf.st_size), filesize_to_str(SIZE_MAX), fnam); // # nocov
1426+
STOP(_("File size [%s] exceeds the address space: %s"), filesize_to_str(stat_buf.st_size), fnam); // # nocov
14271427
}
14281428
fileSize = (size_t) stat_buf.st_size;
14291429
if (fileSize == 0) {close(fd); STOP(_("File is empty: %s"), fnam);}
@@ -1459,7 +1459,7 @@ int freadMain(freadMainArgs _args) {
14591459
if (GetFileSizeEx(hFile,&liFileSize)==0) { CloseHandle(hFile); STOP(_("GetFileSizeEx failed (returned 0) on file: %s"), fnam); }
14601460
if (liFileSize.QuadPart > SIZE_MAX) {
14611461
CloseHandle(hFile); // # nocov
1462-
STOP(_("File is too large [%s > %s]: %s"), filesize_to_str(stat_buf.st_size), filesize_to_str(SIZE_MAX), fnam); // # nocov
1462+
STOP(_("File size [%s] exceeds the address space: %s"), filesize_to_str(liFileSize.QuadPart), fnam); // # nocov
14631463
}
14641464
fileSize = (size_t)liFileSize.QuadPart;
14651465
if (fileSize==0) { CloseHandle(hFile); STOP(_("File is empty: %s"), fnam); }

0 commit comments

Comments
 (0)