aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-03-10 15:40:22 +0000
committerbloodstalker <thabogre@gmail.com>2017-03-10 15:40:22 +0000
commit644799042f1f922b2a5d02ec6912913e11e6fd6a (patch)
treeee7d712cb7a02eceb6cf7e73779b1c194a68c9c8
parentnothing worth mentioning (diff)
downloadmutator-644799042f1f922b2a5d02ec6912913e11e6fd6a.tar.gz
mutator-644799042f1f922b2a5d02ec6912913e11e6fd6a.zip
fixed some of the coverity errors
-rw-r--r--daemon/daemon_aux.c1
-rw-r--r--daemon/mutatorclient.c4
-rw-r--r--daemon/mutatorserver.c1
3 files changed, 5 insertions, 1 deletions
diff --git a/daemon/daemon_aux.c b/daemon/daemon_aux.c
index cce2372..86e57ee 100644
--- a/daemon/daemon_aux.c
+++ b/daemon/daemon_aux.c
@@ -49,6 +49,7 @@ int mutator_server(FILE* log_file)
if (socket_desc < 0)
{
fprintf(log_file, "%s", "could not create socket.\n");
+ exit(EXIT_FAILURE);
}
fprintf (log_file, "%s", "socket created.\n");
diff --git a/daemon/mutatorclient.c b/daemon/mutatorclient.c
index 9177024..d65eef5 100644
--- a/daemon/mutatorclient.c
+++ b/daemon/mutatorclient.c
@@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
/*standard header libraries*/
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
@@ -47,6 +48,7 @@ int main(int argc, char *argv[])
if (sock == -1)
{
printf ("could not create socket");
+ exit(EXIT_FAILURE);
}
puts("created socket");
@@ -69,7 +71,7 @@ int main(int argc, char *argv[])
printf("enter massage: ");
/*@DEVI-should later do something about reading from stdin*/
- if (fgets(message, 4000, stdin) == NULL)
+ if (fgets(message, 1000, stdin) == NULL)
{
puts("could not read from stdin");
}
diff --git a/daemon/mutatorserver.c b/daemon/mutatorserver.c
index 13a31d3..99f86c1 100644
--- a/daemon/mutatorserver.c
+++ b/daemon/mutatorserver.c
@@ -49,6 +49,7 @@ int main (int argc, char *argv[])
if (socket_desc < 0)
{
printf("could not create socket.");
+ exit(EXIT_FAILURE);
}
puts ("socket created.");