update calloc ref #29

This commit is contained in:
Eric Betts
2026-03-03 17:23:05 -08:00
parent 7dddfb5a32
commit c7e2bea0f2
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -59,7 +59,11 @@ uint8_t select_desfire_app_no_le[] =
uint8_t FILE_NOT_FOUND[] = {0x6a, 0x82};
void* calloc(size_t count, size_t size) {
return malloc(count * size);
void* ptr = malloc(count * size);
if(ptr) {
memset(ptr, 0, count * size);
}
return ptr;
}
// Forward declarations
+1 -1
View File
@@ -19,7 +19,7 @@ void seader_send_card_detected(SeaderUartBridge* seader_uart, CardDetails_t* car
/***************************** Seader Worker API *******************************/
SeaderWorker* seader_worker_alloc() {
SeaderWorker* seader_worker = malloc(sizeof(SeaderWorker));
SeaderWorker* seader_worker = calloc(1, sizeof(SeaderWorker));
// Worker thread attributes
seader_worker->thread =