lib: fix strntol's end pointer when str has leading spaces