How to remove first character from C-string?
if (contents[0] == '\n')
memmove(contents, contents+1, strlen(contents));
Or, if the pointer can be modified:
if (contents[0] == '\n') contents++;
char* contents_chopped = contents + 1;
This will result in contents_chopped
pointing to the same string, except the first char will be the next after \n
Also, this method is faster.