Refactor yes.c

use err_exit