fix comparison of unsigned expression < 0

size_t is an unsigned type and comparison of a value of it < 0 is always false.