add readme, installation

This commit is contained in:
opfez 2021-08-06 13:45:39 +02:00
parent fd792b6d64
commit ce95b741c3
3 changed files with 11 additions and 3 deletions

View File

@ -3,3 +3,6 @@ CFLAGS = -Wall -Wextra -std=c99 -pedantic -g
finger: finger.c
$(CC) $(CFLAGS) $< -o $@
install: finger
cp $< /usr/bin/finger

5
README Normal file
View File

@ -0,0 +1,5 @@
This is a simple finger client.
Usage: finger [user] server
Installation: make install

View File

@ -19,9 +19,8 @@ void
read_server_response(int sockfd)
{
char c;
while (read(sockfd, &c, 1) != 0) {
if (c != '\r')
putchar(c);
while (read(sockfd, &c, 1)) {
putchar(c);
}
}
@ -58,6 +57,7 @@ main(int argc, char *argv[])
user = argv[1];
}
/* setting up sockets and stuff */
struct sockaddr_in servaddr;
int sockfd = socket(AF_INET, SOCK_STREAM, 0);