liblog: fix if termination