From e03d31060ab12f1f26a43b8697a2bdc28d5e5c9d Mon Sep 17 00:00:00 2001 From: LiteOS2021 Date: Sat, 29 Jan 2022 16:36:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(ftell.c):=20=5F=5Fftello=5Funlocked?= =?UTF-8?q?=E8=B0=83=E7=94=A8lseek,=E5=BC=BA=E8=BD=AC=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E4=B8=AA=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit __ftello_unlocked调用lseek,强转第二个入参 Signed-off-by: LiteOS2021 --- porting/liteos_m/kernel/src/stdio/ftell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/porting/liteos_m/kernel/src/stdio/ftell.c b/porting/liteos_m/kernel/src/stdio/ftell.c index d15cc665..8cf4252b 100644 --- a/porting/liteos_m/kernel/src/stdio/ftell.c +++ b/porting/liteos_m/kernel/src/stdio/ftell.c @@ -4,7 +4,7 @@ off_t __ftello_unlocked(FILE *f) { - off_t pos = lseek(f->fd, 0, + off_t pos = lseek(f->fd, (off_t)0, (f->flags & F_APP) && f->wpos != f->wbase ? SEEK_END : SEEK_CUR); if (pos < 0) return pos; -- GitLab