diff options
| author | Miguel <m.i@gmx.at> | 2018-09-21 11:08:21 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-21 11:08:21 +0200 |
| commit | 6125ac9b8c864eeeb4619021cdde0f40e784fc14 (patch) | |
| tree | 688d6855c974e2c831e58da94eb61a27a9a0abb6 /userspace/grep.c | |
| parent | d4bc2ecdd1d0b3d3f3642a5f02840d1e0cb5e199 (diff) | |
cleaning at userspace
Diffstat (limited to 'userspace/grep.c')
| -rw-r--r-- | userspace/grep.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/userspace/grep.c b/userspace/grep.c index 058f1f8..d3ca687 100644 --- a/userspace/grep.c +++ b/userspace/grep.c @@ -49,11 +49,12 @@ int main(int argc, char **argv) FILE *out=stdout; int i=1; - while(!feof(in)) + + char buf[256]; + char buf2[255]; + + while(NULL!=fgets(buf,255,in)) { - char buf[256]; - char buf2[255]; - fgets(buf,255,in); char *pos=strstr(buf,argv[1]); if(pos) |
