From 053b68faf1f1dd87b73a867c08f53d28d1d2c1c0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 3 Feb 2021 13:59:27 +0000 Subject: [PATCH] Refactoring: in preparation for ECC-822 --- tools/grib_get_data.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/grib_get_data.c b/tools/grib_get_data.c index 0960cb0cb..86dd7f35a 100644 --- a/tools/grib_get_data.c +++ b/tools/grib_get_data.c @@ -85,7 +85,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) int i = 0; grib_values* values = NULL; grib_iterator* iter = NULL; - char* format = NULL; + char* format_values = NULL; char* default_format = "%.10e"; int print_keys = grib_options_on("p:"); long numberOfPoints = 0; @@ -128,9 +128,9 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) } if (grib_options_on("F:")) - format = grib_options_get_option("F:"); + format_values = grib_options_get_option("F:"); else - format = default_format; + format_values = default_format; if ((err = grib_get_long(h, "numberOfPoints", &numberOfPoints)) != GRIB_SUCCESS) { fprintf(dump_file, "ERROR: unable to get number of points\n"); @@ -217,7 +217,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) if (is_missing_val) fprintf(dump_file, "%s", missing_string); else - fprintf(dump_file, format, data_values[i]); + fprintf(dump_file, format_values, data_values[i]); if (print_keys) print_key_values(values, options->print_keys_count); @@ -238,7 +238,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) if (!is_missing_val) { if (iter) fprintf(dump_file, "%9.3f%9.3f ", lats[i], lons[i]); - fprintf(dump_file, format, data_values[i]); + fprintf(dump_file, format_values, data_values[i]); if (print_keys) print_key_values(values, options->print_keys_count); fprintf(dump_file, "\n");