What is the behavior of %(limit)[^\n] in scanf ? It is safety from overflow?
问题 The format %(limit)[^\n] for scanf function is unsafe ? (where (limit) is the length -1 of the string) If it is unsafe, why ? And there is a safe way to implement a function that catch strings just using scanf() ? On Linux Programmer's Manual, (typing man scanf on terminal), the s format said: Matches a sequence of non-white-space characters; the next pointer must be a pointer to character array that is long enough to hold the input sequence and the terminating null byte ('\0'),which is added