further fix for #1407
This commit is contained in:
Родитель
35ef551f44
Коммит
5c35062c00
|
@ -1642,6 +1642,7 @@ LibraryManager.library = {
|
|||
next = get();
|
||||
{{{ makeSetValue('argPtr++', 0, 'next', 'i8') }}};
|
||||
}
|
||||
if (next === 0) return fields-1; // we failed to read this field
|
||||
formatIndex += nextC - formatIndex + 1;
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -11,4 +11,18 @@ int main() {
|
|||
i = sscanf(date, "%d.%d.%3c", &d, &m, c);
|
||||
printf("date: %s; day %2d, month %2d, year %4d, extra: %s, %d\n", date, d, m,
|
||||
y, c, i);
|
||||
|
||||
{
|
||||
char *date = "18.07.2013", c;
|
||||
int y, m, d, i;
|
||||
if ((i = sscanf(date, "%d.%d.%4d%c", &d, &m, &y, &c)) == 3)
|
||||
{
|
||||
printf("date: %s; day %2d, month %2d, year %4d \n", date, d, m, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Error in sscanf: actually parsed %d", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
date: 18.07.2013w; day 18, month 7, year 2013, extra: w, 4
|
||||
date: 18.07.2013w; day 18, month 7, year 2013, extra: 201, 3
|
||||
date: 18.07.2013; day 18, month 7, year 2013
|
||||
|
|
|
@ -3853,7 +3853,6 @@ Pass: 0.000012 0.000012''')
|
|||
def test_sscanf_6(self):
|
||||
test_path = path_from_root('tests', 'core', 'test_sscanf_6')
|
||||
src, output = (test_path + s for s in ('.in', '.out'))
|
||||
|
||||
self.do_run_from_file(src, output)
|
||||
|
||||
def test_sscanf_skip(self):
|
||||
|
|
Загрузка…
Ссылка в новой задаче