prevent underflow in KeepLogSeg()

prevent underflow in KeepLogSeg()

Edit