As per the C standard, calling ungetc() with the character parameter equal to EOF causes it to fail, returning EOF. Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx> --- v2: Correct English grammar usage for "otherwise". --- man3/fgetc.3 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/man3/fgetc.3 b/man3/fgetc.3 index 75dcaeaf6..751a00407 100644 --- a/man3/fgetc.3 +++ b/man3/fgetc.3 @@ -62,7 +62,13 @@ A terminating null byte (\[aq]\e0\[aq]) is stored after the last character in the buffer. .PP .BR ungetc () -pushes +returns +.B EOF +if the value of +.I c +equals that of the macro +.BR EOF . +Otherwise, it pushes .I c back to .IR stream , -- 2.39.2