remove undefined behavior flush (stdin) call
http://stackoverflow.com/questions/2979209/using-fflushstdin
checking sizeof (void) at the runtime
add field limit for sscanf call (fix libc versions older than 2.13-25)