updates to parsing on puzzles.cgi

This commit is contained in:
Aaron J. McPhall 2012-05-30 13:51:40 -06:00
parent 2826a69900
commit 698c4486ae
1 changed files with 5 additions and 3 deletions

View File

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