From 672482b2c8b9285b926bb0605a2aff6e89cd1cc0 Mon Sep 17 00:00:00 2001 From: "Aaron J. McPhall" Date: Wed, 30 May 2012 13:51:40 -0600 Subject: [PATCH] updates to parsing on puzzles.cgi --- packages/mcp/src/puzzles.cgi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/mcp/src/puzzles.cgi.c b/packages/mcp/src/puzzles.cgi.c index 3a8e197..1ef81db 100644 --- a/packages/mcp/src/puzzles.cgi.c +++ b/packages/mcp/src/puzzles.cgi.c @@ -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(" %ld\n", cat, points, points);