Fix off-by-one in call to realloc()
Fix dead stores
Move code block into separate function
Arithmetic on void pointer is forbidden
Zero sized arrays are forbidden
Static initializers should not be empty
Remove comma at end of enumeration lists
Minor cleanup