add readme, installation
This commit is contained in:
parent
fd792b6d64
commit
ce95b741c3
3
Makefile
3
Makefile
|
@ -3,3 +3,6 @@ CFLAGS = -Wall -Wextra -std=c99 -pedantic -g
|
|||
|
||||
finger: finger.c
|
||||
$(CC) $(CFLAGS) $< -o $@
|
||||
|
||||
install: finger
|
||||
cp $< /usr/bin/finger
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
This is a simple finger client.
|
||||
|
||||
Usage: finger [user] server
|
||||
|
||||
Installation: make install
|
6
finger.c
6
finger.c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue