1
0
Fork 0

scanf: don't bark on empty test string if format ends with number element

This commit is contained in:
mfranz 2008-10-02 00:58:57 +00:00
parent 5fd89049bb
commit 3fbb11b27a

View file

@ -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`)