From 5ff5f1b28b5f610e79a372ab684d9f29f04d3268 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 11 Jun 2013 13:10:02 +0100 Subject: [PATCH] GRIB-383: grib_get reports negative length for grib message --- tools/grib_tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/grib_tools.c b/tools/grib_tools.c index 01463ac42..69c909407 100644 --- a/tools/grib_tools.c +++ b/tools/grib_tools.c @@ -788,7 +788,7 @@ void grib_print_key_values(grib_runtime_options* options,grib_handle* h) { break; case GRIB_TYPE_LONG: ret=grib_get_long( h,options->print_keys[i].name,&lvalue); - sprintf(value,"%d",(int)lvalue); + sprintf(value,"%ld", lvalue); break; default: fprintf(dump_file,"invalid format option for %s\n",options->print_keys[i].name);