From 0673cb9613d333c8ad03fb71e62c531385000c71 Mon Sep 17 00:00:00 2001 From: Bohdan Yanchyk Date: Fri, 3 Apr 2020 07:28:00 +0000 Subject: [PATCH] =?UTF-8?q?Aktualizovat=20=E2=80=9Edu4/program.c=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du4/program.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/du4/program.c b/du4/program.c index 4fd753e..8df203f 100644 --- a/du4/program.c +++ b/du4/program.c @@ -75,9 +75,15 @@ char checkend(void){ if(c==EOF || c=='\n'){ int a=c; if((c=getchar())==EOF){ + int b=c; + if((c=getchar())==EOF){ + ++count; + fseek(stdin,-count,SEEK_CUR); + return c; + } ++count; - fseek(stdin,-count,SEEK_CUR); - return c; + fseek(stdin,-count,SEEK_CUR); + return b; } ++count; fseek(stdin,-count,SEEK_CUR);