updates to parsing on puzzles.cgi

This commit is contained in:
Aaron J. McPhall 2012-05-30 13:51:40 -06:00
parent 64f0be973e
commit 672482b2c8
1 changed files with 5 additions and 3 deletions

View File

@ -66,9 +66,11 @@ main(int argc, char *argv[])
int i;
while (f && (! feof(f))) {
read_until_char(f, NULL, 0, ' ');
read_until_char(f, NULL, 0, ' ');
read_until_char(f, cat, sizeof(cat), ' ');
read_until_char(f, points_str, sizeof(points_str), '\n');
read_until_char(f, points_str, sizeof(points_str), ' ');
read_until_char(f, NULL, 0, '\n');
points = atol(points_str);
for (i = 0; i < ncats; i += 1) {
@ -133,8 +135,8 @@ main(int argc, char *argv[])
char points_str[20];
long points;
read_until_char(map, cat, sizeof(cat), ' ');
read_until_char(map, points_str, sizeof(points_str), '\n');
read_until_char(map, points_str, sizeof(points_str), ' ');
read_until_char(map, cat, sizeof(cat), '\n');
points = atol(hash);
printf(" <a href=\"/%s/%ld/\">%ld</a>\n", cat, points, points);