The exit
function does not return. It calls function defined with atexit()
, does some cleanup, and terminates the process by calling Linux with function 0 (EXIT)
.
Use return 1
/ return 0
instead of exit(1)
/ exit(0)
, if you want to check what happens with your EIP
after main()
is finished.