fixed an error reading old datafiles (vortex not read properly)

This commit is contained in:
Enno Rehling 2008-06-18 08:24:11 +00:00
parent d418aca832
commit af5477286b
1 changed files with 10 additions and 5 deletions

View File

@ -103,11 +103,16 @@ static void
txt_r_tok_buf(struct storage * store, char * result, size_t size) txt_r_tok_buf(struct storage * store, char * result, size_t size)
{ {
char format[16]; char format[16];
format[0]='%'; if (result && size>0) {
sprintf(format+1, "%us", size); format[0]='%';
fscanf((FILE *)store->userdata, format, result); sprintf(format+1, "%us", size);
if (result[0]==NULL_TOKEN) { fscanf((FILE *)store->userdata, format, result);
result[0] = 0; if (result[0]==NULL_TOKEN) {
result[0] = 0;
}
} else {
/* trick to skip when no result expected */
fscanf((FILE *)store->userdata, "%*s", format);
} }
} }