I'm trying to parse a file that another function has written with this fprintf:
fprintf(file, "DS;%s;%ld;%ld;%u\n", ds->name, ds->start, ds->period, ds->size)
I'm using this fscanf:
fscanf(file, "DS;%[^;$]s;%ld;%ld;%u", file_name, &file_start, &file_period, &file_size)
file_name is read with no problems. but file_start, file_period and file_size are always 0, even if not expected.
For exemple, the string:
DS;failures;1363978800;600;144
Is parsed like this:
- file_name: failures (ok)
- file_start: 0 (ko)
- file_period: 0 (ko)
- file_size: 0 (ko)
What am I doing wrong?