I just saw this code:
artist = (char *) malloc(0);
...and I was wondering why would one do this?
Just to correct a false impression here:
artist = (char *) malloc(0); will never ever return NULL; it's not the same as artist = NULL;. Write a simple program and compare artist with NULL. if (artist == NULL) is false and if (artist) is true.
NULL
artist = NULL;
artist
if (artist == NULL)
if (artist)