diff --git a/examples/NFDB.jl b/examples/NFDB.jl index 16bc3796c5..46c8a3c62b 100644 --- a/examples/NFDB.jl +++ b/examples/NFDB.jl @@ -523,6 +523,11 @@ function _parse(::Type{Int}, io, start = Base.read(io, UInt8)) end lo = UInt8('0') up = UInt8('9') + + if !(lo <= b <= up) + error("Not a number") + end + while !eof(io) && lo <= b <= up res = res * exp + (b - lo) b = Base.read(io, UInt8) @@ -596,6 +601,10 @@ function _parse(::Type{ZZRingElem}, io, start = Base.read(io, UInt8)) up = UInt8('9') mi = UInt8('-') + if !((lo <= b <= up) || b == mi) + error("Not a number") + end + while (lo <= b <= up) || b == mi Base.write(n, b) if eof(io)