Added missing check for negative number where size_t is expected.

Found by AI0867.