Fix potential buffer overrun when parsing a number at the end of a non null-terminated buffer