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);