all, I am designing a Key-Value server, and when I wrote the client, and I found a really strange thing,see the simplified code:

```
while(1)
{
    printf("->:");
    read(STDIN_FILENO, buf, sizeof(buf));
    write(client_sock, buf, sizeof(buf));
    int m = read(client_sock, buf, sizeof(buf));
    buf[m] = '\0';
    printf("%s", buf);
}

```

when I run the program, it first ask for input, so I input something, but nothing happen!
(the server runs well, and it well echo something, when I use other client)

then I change the code only one line:

```
printf("\n->:");

```

then it runs well! why? why "\n" can change the output? I guess it maybe the read() , but I can't explain it