minor warnings fix
parent
4504528bf2
commit
b799e7d696
|
@ -19,6 +19,7 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#define MAXDATASIZE 4096 /* maximum acceptable amount of data */
|
#define MAXDATASIZE 4096 /* maximum acceptable amount of data */
|
||||||
#define SERV_PORT 11111 /* define default port number */
|
#define SERV_PORT 11111 /* define default port number */
|
||||||
|
|
||||||
const char* cert = "..../certs/ca-cert.pem";
|
const char* cert = "../certs/ca-cert.pem";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* enum used for tcp_select function
|
* enum used for tcp_select function
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -181,14 +182,15 @@ int main(int argc, char** argv)
|
||||||
servAddr.sin_port = htons(SERV_PORT); /* sets port to defined port */
|
servAddr.sin_port = htons(SERV_PORT); /* sets port to defined port */
|
||||||
|
|
||||||
/* looks for the server at the entered address (ip in the command line) */
|
/* looks for the server at the entered address (ip in the command line) */
|
||||||
if (inet_pton(AF_INET, argv[1], &servAddr.sin_addr) < 1) {
|
if ((ret = inet_pton(AF_INET, argv[1], &servAddr.sin_addr)) < 1) {
|
||||||
/* checks validity of address */
|
/* checks validity of address */
|
||||||
ret = errno;
|
ret = errno;
|
||||||
printf("Invalid Address. Error: %i\n", ret);
|
printf("Invalid Address. Error: %i\n", ret);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connect(sockfd, (struct sockaddr *) &servAddr, sizeof(servAddr)) < 0) {
|
if ((ret = connect(sockfd, (struct sockaddr *) &servAddr,
|
||||||
|
sizeof(servAddr))) < 0) {
|
||||||
/* if socket fails to connect to the server*/
|
/* if socket fails to connect to the server*/
|
||||||
ret = errno;
|
ret = errno;
|
||||||
printf("Connect error. Error: %i\n", ret);
|
printf("Connect error. Error: %i\n", ret);
|
||||||
|
|
Loading…
Reference in New Issue