STRING **array = (STRING *) sys_malloc(sizeof(STRING) * N);
This code line is wrong. It allocates N times the length of a STRING struct!
It should be:
STRING **array = (STRING**) sys_malloc(sizeof(STRING*) * N);
that allocates N times the length of a pointer to a STRING struct.
Salud!
Yeah, I forgot about the extra asterisk! Because it's a pointer to pointer, you should allocate memory for the pointers.
Thanks for pointing it out!