From 644799042f1f922b2a5d02ec6912913e11e6fd6a Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Fri, 10 Mar 2017 19:10:22 +0330 Subject: fixed some of the coverity errors --- daemon/daemon_aux.c | 1 + daemon/mutatorclient.c | 4 +++- daemon/mutatorserver.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'daemon') 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 #include +#include #include #include #include @@ -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."); -- cgit v1.2.3