From 33c2c2d1b2e68d2fdb655a0713d7b3ca10e7b7f9 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Thu, 9 Feb 2023 21:17:31 +0100 Subject: [PATCH] Some cleanups in raw_read() and table_read() --- src/save.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/save.c b/src/save.c index 3a78190c..22a47d39 100644 --- a/src/save.c +++ b/src/save.c @@ -704,11 +704,11 @@ int raw_read(const char *f, const char *type) { int res = 0; FILE *fd; - int_hash_init(&xctx->graph_raw_table, HASHSIZE); if(xctx->graph_values || xctx->graph_npoints || xctx->graph_nvars || xctx->graph_datasets) { dbg(0, "raw_read(): must clear current raw file before loading new\n"); return res; } + int_hash_init(&xctx->graph_raw_table, HASHSIZE); fd = fopen(f, fopen_read_mode); if(fd) { if((res = read_dataset(fd, type)) == 1) { @@ -764,11 +764,11 @@ int table_read(const char *f) char *line = NULL, *line_ptr, *line_save; const char *line_tok; - int_hash_init(&xctx->graph_raw_table, HASHSIZE); if(xctx->graph_values || xctx->graph_npoints || xctx->graph_nvars || xctx->graph_datasets) { - dbg(0, "raw_read(): must clear current data file before loading new\n"); + dbg(0, "table_read(): must clear current data file before loading new\n"); return res; } + int_hash_init(&xctx->graph_raw_table, HASHSIZE); fd = fopen(f, fopen_read_mode); if(fd) { int nline = 0;