compared to -1 (instead of <0 or !=0) and always to call err() with EXIT_FAILURE instead of sometimes using 1.