Invalid command!
This commit is contained in:
parent
ca7cb9294d
commit
b5be741617
|
@ -69,7 +69,12 @@ void connectedCommunication(int sockfd)
|
||||||
// Reading server answer
|
// Reading server answer
|
||||||
read(sockfd, receiveBuff, sizeof(receiveBuff));
|
read(sockfd, receiveBuff, sizeof(receiveBuff));
|
||||||
|
|
||||||
printf("%s\n", receiveBuff);
|
// Detect null-string returned
|
||||||
|
if (receiveBuff[0] == 0) {
|
||||||
|
printLog("An error occured or invalid command!");
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%s\n\n", receiveBuff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ static void serverCommunicationInstance(Server_t *args, int sockfd)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zeroing buffer
|
// Zeroing buffer
|
||||||
snprintf(sendBuff, SEND_BUFFER_SIZE, "%s", "Invalid command!");
|
bzero(sendBuff, RECEIVE_BUFFER_SIZE);
|
||||||
|
|
||||||
// Execute command by first arg in cmdList
|
// Execute command by first arg in cmdList
|
||||||
for (int i = 0; i < LEN(cmdList); i++) {
|
for (int i = 0; i < LEN(cmdList); i++) {
|
||||||
|
|
Loading…
Reference in New Issue