One thing to keep in mind about your function simple_read_all() is that whenever you use it you must capture the return value and free it when you are done with it. Otherwise you will spring a memory leak.
It appears that you wish to use it, in this context, to flush the input, however, it does nothing of the sort. To flush stdin you need to use fflush(), if you want to clear the console in windows you want to do the equivalent of typing cls at the prompt _tsystem(_T("cls")) or without generics system("cls"). In my console menu project I created the following macro to simplify this: #define Console_Clear() (fflush(stdin), _tsystem(_T("cls"))).
simple_read_all() was designed to read arbitrary lengths of text from stdin and return an allocated buffer. This is good for a console based chat for instance, but not for what you want to do. Don't use a tank to plow the garden just because you happen to have one in the village.