mirror of https://github.com/dirtbags/moth.git
updates to parsing on puzzles.cgi
This commit is contained in:
parent
06a8e6da8d
commit
c4affbbd5f
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue