From 57b3028c78d92222fd5a26167386bc4491678eaa Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Sat, 4 Mar 2017 13:17:56 +0330 Subject: now uses fgets we don't habe the whitespace problem anymore --- daemon/mutatorclient.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'daemon/mutatorclient.c') 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); -- cgit v1.2.3