diff --git a/programs/winetest/main.c b/programs/winetest/main.c index d749f00270..845b9b6a99 100644 --- a/programs/winetest/main.c +++ b/programs/winetest/main.c @@ -411,7 +411,7 @@ run_tests (char *logname, const char *tag, const char *url) char *strres, *eol, *nextline; DWORD strsize; - SetErrorMode (SEM_NOGPFAULTERRORBOX); + SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); if (!logname) { logname = tempnam (0, "res"); diff --git a/programs/winetest/send.c b/programs/winetest/send.c index e95fc244aa..6cd2e9fcc8 100644 --- a/programs/winetest/send.c +++ b/programs/winetest/send.c @@ -140,9 +140,9 @@ send_file (const char *name) filesize = ftell (f); if (filesize > 1024*1024) { report (R_WARNING, - "File too big (%d > 1 MB), copy and submit manually", - filesize); - goto abort2; + "File too big (%.1f MB > 1 MB); submitting partial report.", + filesize/1024.0/1024); + filesize = 1024*1024; } fseek (f, 0, SEEK_SET); @@ -159,7 +159,14 @@ send_file (const char *name) report (R_STATUS, "Sending %u bytes of data", filesize); report (R_PROGRESS, 2, filesize); - while ((bytes_read = fread (buffer, 1, BUFLEN / 2, f))) { + total = 0; + while (total < filesize && (bytes_read = fread (buffer, 1, BUFLEN/2, f))) { + if ((signed)bytes_read == -1) { + report (R_WARNING, "Error reading log file: %d", errno); + goto abort2; + } + total += bytes_read; + if (total > filesize) bytes_read -= total - filesize; if (send_buf (s, buffer, bytes_read)) { report (R_WARNING, "Error sending body: %d, %d", errno, WSAGetLastError ());