mirror of
https://github.com/dlang/phobos.git
synced 2025-05-03 08:30:33 +03:00
let parse() with radix throw on empty input
This commit is contained in:
parent
10d636b7b3
commit
b1c121dbb0
1 changed files with 4 additions and 1 deletions
|
@ -1965,11 +1965,12 @@ body
|
|||
immutable uint beyond = (radix < 10 ? '0' : 'a'-10) + radix;
|
||||
|
||||
Target v = 0;
|
||||
size_t i = 0;
|
||||
|
||||
if (s.empty)
|
||||
goto Lerr;
|
||||
|
||||
for (; !s.empty; s.popFront())
|
||||
for (; !s.empty; s.popFront(), ++i)
|
||||
{
|
||||
uint c = s.front;
|
||||
if (c < '0')
|
||||
|
@ -1994,6 +1995,8 @@ body
|
|||
goto Loverflow;
|
||||
v = blah;
|
||||
}
|
||||
if (!i)
|
||||
goto Lerr;
|
||||
return v;
|
||||
|
||||
Loverflow:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue