Very basic text editor in C