aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-03-04 09:47:56 +0000
committerbloodstalker <thabogre@gmail.com>2017-03-04 09:47:56 +0000
commit57b3028c78d92222fd5a26167386bc4491678eaa (patch)
tree5bacadd5f787ccd9d359b89fc221b459d27f2b68
parentthe server header (diff)
downloadmutator-57b3028c78d92222fd5a26167386bc4491678eaa.tar.gz
mutator-57b3028c78d92222fd5a26167386bc4491678eaa.zip
now uses fgets we don't habe the whitespace problem anymore
-rw-r--r--daemon/mutatorclient.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/daemon/mutatorclient.c b/daemon/mutatorclient.c
index b266f65..dfc0ec4 100644
--- a/daemon/mutatorclient.c
+++ b/daemon/mutatorclient.c
@@ -62,7 +62,13 @@ int main(int argc, char *argv[])
while(1)
{
printf("enter massage: ");
- scanf("%s", message);
+
+ /*@DEVI-should later do something about reading from stdin*/
+ if (fgets(message, 2000, stdin) == NULL)
+ {
+ puts("could not read from stdin");
+ }
+ puts("read from stdin.");
/*send some data*/
if (send(sock, message, strlen(message), 0) < 0)
@@ -81,10 +87,12 @@ int main(int argc, char *argv[])
puts("server reply: ");
puts(server_reply);
+#if 0
if (strncmp(server_reply, "end_comm", strlen(server_reply)))
{
break;
}
+#endif
}
close(sock);