scanf: don't bark on empty test string if format ends with number element
This commit is contained in:
parent
5fd89049bb
commit
3fbb11b27a
1 changed files with 3 additions and 1 deletions
|
@ -288,7 +288,9 @@ var scanf = func(test, format, result) {
|
|||
var sign = 1;
|
||||
if (f == `d` or f == `f` or f == `u`) {
|
||||
var c = str.getc();
|
||||
if (c == `+`) {
|
||||
if (c == nil) {
|
||||
return 0;
|
||||
} elsif (c == `+`) {
|
||||
prefix = 1;
|
||||
} elsif (c == `-`) {
|
||||
if (f == `u`)
|
||||
|
|
Loading…
Add table
Reference in a new issue