At this point the pointer has been allocated.
If the pointer addresses are the same, then there is no problem.
If they are different, then this properly replaces.
Assigning this just removes the extra step of checking.
memset(((uint8_t *) new_pointer) + (type_size * length_old), 0, type_size * (length_new - length_old));
}
- if (pointer != new_pointer) {
- *pointer = new_pointer;
- }
+ *pointer = new_pointer;
return F_none;
}
memset(((uint8_t *) new_pointer) + (type_size * length_old), 0, type_size * (length_new - length_old));
}
- if (pointer != new_pointer) {
- *pointer = new_pointer;
- }
+ *pointer = new_pointer;
return F_none;
}