From d82238b485495b53bb22ed89cc53ede86ada3258 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 23 Oct 2022 11:14:18 +0200 Subject: [PATCH] libc: Add return value to ungetc() --- libs/libc/src/file.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/libc/src/file.cpp b/libs/libc/src/file.cpp index d8091b5a..af14e3fc 100644 --- a/libs/libc/src/file.cpp +++ b/libs/libc/src/file.cpp @@ -176,8 +176,12 @@ extern "C" { stream->f_bufoff--; stream->f_buf[stream->f_bufoff] = (char)c; + return c; + } + else + { + return EOF; // FIXME: Handle this case properly. } - else { NOT_IMPLEMENTED("ungetc with buffer that has not been read"); } } int ferror(FILE* stream)