minor warnings fix

pull/1/head
CJ 2014-06-30 10:03:53 -06:00
parent 4504528bf2
commit b799e7d696
3 changed files with 6 additions and 3 deletions

View File

@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

View File

@ -29,7 +29,7 @@
#define MAXDATASIZE 4096 /* maximum acceptable amount of data */
#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

View File

@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.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 */
/* 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 */
ret = errno;
printf("Invalid Address. Error: %i\n", ret);
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*/
ret = errno;
printf("Connect error. Error: %i\n", ret);