added return value check to client & server getline
This commit is contained in:
parent
bd3eb8ed4a
commit
abe76d79f0
@ -51,7 +51,7 @@ int main(void)
|
||||
|
||||
//GET IP
|
||||
printf("Welcome.\n\nEnter IP Address:\n>>> ");
|
||||
getline(&line, &line_length, stdin);
|
||||
if (getline(&line, &line_length, stdin) == -1) why2_die("Reading input failed."); //TODO: Add enums to why2_die()
|
||||
|
||||
server_addr.sin_addr.s_addr = inet_addr(line);
|
||||
|
||||
|
@ -61,7 +61,7 @@ int main(void)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
getline(&line_buffer, &line_length_buffer, stdin);
|
||||
if (getline(&line_buffer, &line_length_buffer, stdin) == -1) why2_die("Reading input failed.");
|
||||
|
||||
if (strcmp(line_buffer, "!exit\n") == 0) //USER REQUESTED PROGRAM EXIT
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user