%10s
for first name reads only first 10 characters - UmbertoOve
- from input string and puts into firstname
. The remaining - rflow
- are still in the input buffer of program and scanf()
for surname
takes those characters. '\n'
- or Return - key
pressed while entering first name works as terminator and adds rflow
in surname
.
Its not buffer overflow, but expected behavior.