Will the gets()
function from C language (e.g. from glibc) stop, if it reads a zero byte ('\0'
) from the file ?
Quick test: echo -ne 'AB\0CDE'
Thanks.
PS this question arises from comments in this question: return to libc - problem
PPS the gets
function is dangerous, but it is a question about this function itself, not about should anybody use it or not.
gets
: stackoverflow.com/questions/1694036/…gets
to illustrate its dangerous (see linked Q).