I am wondering how does printf() figure out when to stop printing a string, even I haven\'t put a termination character at the end of the string? I did an experiment by mall
There's a good chance that one of the characters after the string is NULL, so printf stops there, furthermore, characters that are not NULL after the memory that you malloced might not be printable characters so you won't notice them in the terminal.