|
29 | 29 | // Global Variables //
|
30 | 30 | ////////////////////////
|
31 | 31 | const char* util_name = "openSeaChest_Raw";
|
32 |
| -const char* buildVersion = "0.9.0"; |
| 32 | +const char* buildVersion = "0.9.1"; |
33 | 33 |
|
34 | 34 | ////////////////////////////
|
35 | 35 | // functions to declare //
|
@@ -550,14 +550,14 @@ int main(int argc, char* argv[])
|
550 | 550 | uint32_t multiplier = UINT32_C(1);
|
551 | 551 | if (unit)
|
552 | 552 | {
|
553 |
| - if (strcmp(unit, "") == 0) |
| 553 | + if (strcmp(unit, "BLOCKS") == 0 || strcmp(unit, "SECTORS") == 0) |
554 | 554 | {
|
| 555 | + // they specified blocks. For log transfers this means a number of 512B sectors |
555 | 556 | RAW_DATA_LEN_ADJUST_BY_BLOCKS_FLAG = true;
|
556 | 557 | }
|
557 |
| - else if (strcmp(unit, "BLOCKS") == 0 || strcmp(unit, "SECTORS") == 0) |
| 558 | + else if (strcmp(unit, "B") == 0 || strcmp(unit, "") == 0) |
558 | 559 | {
|
559 |
| - // they specified blocks. For log transfers this means a number of 512B sectors |
560 |
| - multiplier = LEGACY_DRIVE_SEC_SIZE; |
| 560 | + multiplier = UINT32_C(1); |
561 | 561 | }
|
562 | 562 | else if (strcmp(unit, "KB") == 0)
|
563 | 563 | {
|
@@ -590,6 +590,7 @@ int main(int argc, char* argv[])
|
590 | 590 | }
|
591 | 591 | }
|
592 | 592 | RAW_DATA_LEN_FLAG *= multiplier;
|
| 593 | + printf("Raw data len = %" PRIu32 "\n", RAW_DATA_LEN_FLAG); |
593 | 594 | }
|
594 | 595 | else
|
595 | 596 | {
|
@@ -1316,7 +1317,7 @@ int main(int argc, char* argv[])
|
1316 | 1317 | dataBuffer = M_REINTERPRET_CAST(
|
1317 | 1318 | uint8_t*, safe_calloc_aligned(allocatedDataLength, sizeof(uint8_t),
|
1318 | 1319 | deviceList[deviceIter].os_info.minimumAlignment));
|
1319 |
| - if (!dataBuffer) |
| 1320 | + if (dataBuffer == M_NULLPTR) |
1320 | 1321 | {
|
1321 | 1322 | if (VERBOSITY_QUIET < toolVerbosity)
|
1322 | 1323 | {
|
@@ -1620,9 +1621,7 @@ int main(int argc, char* argv[])
|
1620 | 1621 | exitCode = UTIL_EXIT_ERROR_IN_COMMAND_LINE;
|
1621 | 1622 | }
|
1622 | 1623 | }
|
1623 |
| - |
1624 |
| - // perform some sort of validation to see that we have some command to send...then build it and send it. |
1625 |
| - if (RAW_TFR_SIZE_FLAG != 0 && RAW_TFR_PROTOCOL != -1 && RAW_TFR_XFER_LENGTH_LOCATION != -1 && |
| 1624 | + else if (RAW_TFR_SIZE_FLAG != 0 && RAW_TFR_PROTOCOL != -1 && RAW_TFR_XFER_LENGTH_LOCATION != -1 && |
1626 | 1625 | RAW_TFR_BYTE_BLOCK != -1)
|
1627 | 1626 | {
|
1628 | 1627 | ataPassthroughCommand passthroughCommand;
|
|
0 commit comments