update Makefile and fix minor bugs
This commit is contained in:
@@ -3,7 +3,7 @@ CFLAGS = -g
|
|||||||
CPPFLAGS = -Wall -Wextra -pedantic -std=gnu90
|
CPPFLAGS = -Wall -Wextra -pedantic -std=gnu90
|
||||||
|
|
||||||
chatty: main.o liblist.a
|
chatty: main.o liblist.a
|
||||||
$(CC) $(CFLAGS) -L. -o chatty main.o -llist -lpthread
|
$(CC) $(CFLAGS) -L. -o chatty main.o -llist -lpthread -lncurses
|
||||||
|
|
||||||
main.o: main.c
|
main.o: main.c
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I. -c -o main.o main.c
|
$(CC) $(CFLAGS) $(CPPFLAGS) -I. -c -o main.o main.c
|
||||||
|
|||||||
@@ -88,7 +88,8 @@ void *receiver(void *arg) {
|
|||||||
bytes = recv(confd, buf, 128, 0);
|
bytes = recv(confd, buf, 128, 0);
|
||||||
|
|
||||||
if (bytes != -1) {
|
if (bytes != -1) {
|
||||||
printf("\nReceived: %s\n", buf);
|
mvprintw(row - 3, 10, ("Message: %s", buf));
|
||||||
|
refresh();
|
||||||
}
|
}
|
||||||
else if (bytes == 0) {
|
else if (bytes == 0) {
|
||||||
pthread_exit("connection closed");
|
pthread_exit("connection closed");
|
||||||
|
|||||||
Reference in New Issue
Block a user