$ gdb ./fle
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU
GPL version 3 or later <http://gnu.org/licenses/
gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/oliver/test/fle...done.
(gdb) b main
Breakpoint 1 at 0x400814: file fle.c, line 54.
(gdb) run
Starting program: /home/oliver/test/fle
Breakpoint 1, main () at fle.c:54
54 int is_sender = TRUE;
(gdb) n
57 if (is_sender) {
(gdb)
58 printf("write:\n");
(gdb)
write:
59 fgets(buffer, BUFFER_LEN, stdin); /* <-- Hier ist der Fehler /////////////////////////////////*/
(gdb) p buffer
$1 = '\000' <repeats 1023 times>
(gdb) p BUFFER_LEN
$2 = 1024
(gdb) c
Continuing.
cjlfwenbchkjwebfcfjwkecbwreckjwrcb
c j l f w e n b c h k j w e b f c f j w k e c b w r e c k j w r c b
read:
dwcjklwshckjwebcwkcwbecwbc