From cab04ef9b8d205bcb5e676d45922b49058659387 Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Thu, 8 Aug 2024 11:28:53 -0700 Subject: [PATCH] fixed test --- src/g2ccsv.c | 5 ++--- tests/tst_csv.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/g2ccsv.c b/src/g2ccsv.c index f21c5b40..a1122e9d 100644 --- a/src/g2ccsv.c +++ b/src/g2ccsv.c @@ -208,13 +208,12 @@ g2c_csv_init() return G2C_ECSV; /* Skip header line */ - fgets(line,max_line_size,doc); + buf = fgets(line,max_line_size,doc); /* Go through the document and save table data. * Each line is a table of codes. */ - while((fgets(line,max_line_size,doc)) != NULL) + while((buf = fgets(line,max_line_size,doc)) != NULL) { - buf = strdup(line); i = 0; while(buf != NULL && i < num_columns) { diff --git a/tests/tst_csv.c b/tests/tst_csv.c index 4c0f9b57..b252980c 100644 --- a/tests/tst_csv.c +++ b/tests/tst_csv.c @@ -27,7 +27,7 @@ main() return G2C_ERROR; /* Calling init again is harmless. */ - if (g2c_xml_init()) + if (g2c_csv_init()) return G2C_ERROR; g2c_free_tables();