Skip to content

Commit

Permalink
fix cat EZLippi#31
Browse files Browse the repository at this point in the history
  • Loading branch information
freakkid committed Jan 25, 2019
1 parent fbd25cf commit 4c981a4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,9 @@ void cat(int client, FILE *resource)
{
char buf[1024];

fgets(buf, sizeof(buf), resource);
while (!feof(resource))
while (fgets(buf, sizeof(buf), resource) != NULL)
{
send(client, buf, strlen(buf), 0);
fgets(buf, sizeof(buf), resource);
}
}

Expand Down

0 comments on commit 4c981a4

Please sign in to comment.