summaryrefslogtreecommitdiff
path: root/userspace/grep.c
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/grep.c')
-rw-r--r--userspace/grep.c9
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)