fix the case with maxolen == 0 in compress