unify test - step 2
This commit is contained in:
1 parent
875b3c44b4
commit
ad292e8810
70 files changed
+272
-195
No files matched your search
+12
-11
@@ -221,7 +221,7 @@ void convertGraphFromBitstreamEx(int hi, int low) {
|
||||
|
||||
uint8_t *bits = calloc(g_GraphTraceLen, sizeof(uint8_t));
|
||||
if (bits == NULL) {
|
||||
PrintAndLogEx(DEBUG, "ERR: convertGraphFromBitstreamEx, failed to allocate memory");
|
||||
PrintAndLogEx(WARNING, "Failed to allocate memory");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -470,20 +470,21 @@ bool fskClocks(uint8_t *fc1, uint8_t *fc2, uint8_t *rf1, int *firstClockEdge) {
|
||||
|
||||
void add_temporary_marker(uint32_t position, const char *label) {
|
||||
if (g_TempMarkerSize == 0) { //Initialize the marker array
|
||||
|
||||
g_TempMarkers = (marker_t *)calloc(1, sizeof(marker_t));
|
||||
if (g_TempMarkers == NULL) { //Unable to allocate memory for the marker array
|
||||
PrintAndLogEx(FAILED, "Unable to allocate memory for the temporary marker array!");
|
||||
if (g_TempMarkers == NULL) { // Unable to allocate memory for the marker array
|
||||
PrintAndLogEx(WARNING, "Failed to allocate memory");
|
||||
return;
|
||||
}
|
||||
} else { //add more space to the marker array using realloc()
|
||||
marker_t *temp = (marker_t *)realloc(g_TempMarkers, ((g_TempMarkerSize + 1) * sizeof(marker_t)));
|
||||
|
||||
} else { //add more space to the marker array using realloc()
|
||||
|
||||
marker_t *temp = (marker_t *)realloc(g_TempMarkers, ((g_TempMarkerSize + 1) * sizeof(marker_t)));
|
||||
if (temp == NULL) { //Unable to reallocate memory for a new marker
|
||||
PrintAndLogEx(FAILED, "Unable to allocate memory for a new temporary marker!");
|
||||
PrintAndLogEx(WARNING, "Failed to allocate memory");
|
||||
free(temp);
|
||||
return;
|
||||
} else {
|
||||
//Set g_TempMarkers to the new pointer
|
||||
g_TempMarkers = temp;
|
||||
}
|
||||
}
|
||||
@@ -492,7 +493,7 @@ void add_temporary_marker(uint32_t position, const char *label) {
|
||||
|
||||
char *markerLabel = (char *)calloc(1, strlen(label) + 1);
|
||||
if (markerLabel == NULL) {
|
||||
PrintAndLogEx(FAILED, "Unable to allocate memory for marker label!");
|
||||
PrintAndLogEx(WARNING, "Failed to allocate memory");
|
||||
return;
|
||||
}
|
||||
strcpy(markerLabel, label);
|
||||
@@ -521,7 +522,7 @@ buffer_savestate_t save_buffer32(uint32_t *src, size_t length) {
|
||||
//calloc the memory needed
|
||||
uint32_t *savedBuffer = (uint32_t *)calloc(length, sizeof(uint32_t));
|
||||
if (savedBuffer == NULL) {
|
||||
PrintAndLogEx(FAILED, "Unable to allocate memory for the buffer!");
|
||||
PrintAndLogEx(WARNING, "Failed to allocate memory");
|
||||
buffer_savestate_t bst = {0};
|
||||
return bst;
|
||||
}
|
||||
@@ -543,7 +544,7 @@ buffer_savestate_t save_bufferS32(int32_t *src, size_t length) {
|
||||
//calloc the memory needed
|
||||
uint32_t *savedBuffer = (uint32_t *)calloc(length, (sizeof(uint32_t)));
|
||||
if (savedBuffer == NULL) {
|
||||
PrintAndLogEx(FAILED, "Unable to allocate memory for the buffer!");
|
||||
PrintAndLogEx(WARNING, "Failed to allocate memory");
|
||||
buffer_savestate_t bst = {0};
|
||||
return bst;
|
||||
}
|
||||
@@ -577,7 +578,7 @@ buffer_savestate_t save_buffer8(uint8_t *src, size_t length) {
|
||||
// calloc the memory needed
|
||||
uint32_t *savedBuffer = (uint32_t *)calloc(buffSize, sizeof(uint32_t));
|
||||
if (savedBuffer == NULL) {
|
||||
PrintAndLogEx(FAILED, "Unable to allocate memory for the buffer!");
|
||||
PrintAndLogEx(WARNING, "Failed to allocate memory");
|
||||
buffer_savestate_t bst = {0};
|
||||
return bst;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user