Fixed an integer limit error causing an endless loop in the UUID block creation

This commit is contained in:
Eric-Paul Ickhorn 2023-12-15 08:37:19 +01:00
parent 0cf6d731c2
commit 2923d292bf
Signed by: epickh
GPG Key ID: F5EBBE013924D95F
1 changed files with 2 additions and 2 deletions

View File

@ -13,8 +13,8 @@ techreg_uuid_block_s techreg_get_uuid_block(techreg_subsystem_e owner, u16_t num
block.first_unassigned = 0;
usz_t num_assignments = num_slots * 512;
block.assignments = malloc(sizeof(u16_t) * num_assignments);
for(u16_t assignment_index = 0; assignment_index < num_assignments; ++assignment_index)
techreg_uuid_block_counter_g += assignment_index + 1;
for(u32_t assignment_index = 0; assignment_index < num_assignments; ++assignment_index)
block.assignments[assignment_index] = assignment_index + 1;
block.assignments[num_assignments-1] = 0;
return block;