execute_cmd doesn't use return value for ending, just use exit()
modify some constant string sizing and use snprintf for protection