Skip to content

Commit 3e30ec2

Browse files
committed
Fix reading of regions.csv
1 parent 82b04d1 commit 3e30ec2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

ArchiveGraphs/archivegraphs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,11 @@ int main(int argc, char *argv[]) {
288288
/* read remaining lines, know we're done when we get an empty code field */
289289
while (1) {
290290
read_to_char(rfp, code, ';');
291-
if (strlen(code) == 0) break;
291+
if (strlen(code) < 2) break;
292292
read_to_char(rfp, name, ';');
293293
read_to_char(rfp, country, ';');
294294
read_to_char(rfp, continent, ';');
295295
read_to_char(rfp, region_type, '\n');
296-
skip_to_eol(rfp);
297296
sprintf(graph_basefilename, "%s-region", code);
298297
sprintf(graph_descr, "%s (%s)", name, region_type);
299298
process_graph_set(graph_basefilename, graph_descr, "region", archive_name,

0 commit comments

Comments
 (0)