Changeset 97656 in vbox
- Timestamp:
- Nov 22, 2022 3:20:34 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r97655 r97656 398 398 RT_NOREF(fFileCopyFlags); 399 399 400 BOOL fCanceled = FALSE; 400 if (!cbSize) /* Nothing to copy, i.e. empty file? Bail out. */ 401 return VINF_SUCCESS; 402 403 BOOL fCanceled = FALSE; 401 404 uint64_t cbWrittenTotal = 0; 402 405 uint64_t cbToRead = cbSize; … … 454 457 break; 455 458 456 vrc = setProgress((ULONG)((double)cbWrittenTotal / (double)cbSize / 100.0)); 459 AssertBreakStmt(cbSize, vrc = VERR_INTERNAL_ERROR); 460 vrc = setProgress(((double)cbWrittenTotal / (double)cbSize) * 100); 457 461 if (RT_FAILURE(vrc)) 458 462 break; … … 470 474 * everything. 471 475 */ 472 if ( cbSize > 0 473 && cbWrittenTotal == 0) 476 if (cbWrittenTotal == 0) 474 477 { 475 478 /* If nothing was transferred but the file size was > 0 then "vbox_cat" wasn't able to write … … 728 731 RT_NOREF(fFileCopyFlags); 729 732 730 BOOL fCanceled = FALSE; 733 if (!cbSize) /* Nothing to copy, i.e. empty file? Bail out. */ 734 return VINF_SUCCESS; 735 736 BOOL fCanceled = FALSE; 731 737 uint64_t cbWrittenTotal = 0; 732 738 uint64_t cbToRead = cbSize; … … 784 790 break; 785 791 786 vrc = setProgress((ULONG)((double)cbWrittenTotal / (double)cbSize / 100.0)); 792 AssertBreakStmt(cbSize, vrc = VERR_INTERNAL_ERROR); 793 vrc = setProgress(((double)cbWrittenTotal / (double)cbSize) * 100); 787 794 if (RT_FAILURE(vrc)) 788 795 break; … … 796 803 * everything. 797 804 */ 798 if ( cbSize > 0 799 && cbWrittenTotal == 0) 805 if (cbWrittenTotal == 0) 800 806 { 801 807 /* If nothing was transferred but the file size was > 0 then "vbox_cat" wasn't able to write
Note:
See TracChangeset
for help on using the changeset viewer.