Write errors to stderr not stdout. Also use const

This commit is contained in:
Shahram Najm 2019-02-28 11:25:20 +00:00
parent e0f7c8bd91
commit 5bac99bc73
2 changed files with 4 additions and 4 deletions

View File

@ -285,7 +285,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
if((err = aec_buffer_decode(&strm)) != AEC_OK)
{
printf("aec_buffer_decode Error %d\n", err);
fprintf(stderr, "aec_buffer_decode Error %d\n", err);
err = GRIB_ENCODING_ERROR;
goto cleanup;
}
@ -496,7 +496,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len)
if((err = aec_buffer_encode(&strm)) != AEC_OK)
{
printf("aec_buffer_encode Error %d\n", err);
fprintf(stderr,"aec_buffer_encode Error %d\n", err);
err = GRIB_ENCODING_ERROR;
goto cleanup;
}

View File

@ -180,7 +180,7 @@ int grib_tool_init(grib_runtime_options* options)
{
int ret=0,i=0;
int nfiles=1;
char orderby[]="md5Headers";
const char orderby[]="md5Headers";
grib_context* context=grib_context_get_default();
options->strict=1;
@ -238,7 +238,7 @@ int grib_tool_init(grib_runtime_options* options)
options->idx=grib_fieldset_new_from_files(context,filename,
nfiles,0,0,0,orderby,&ret);
if (ret) {
printf("unable to create index for input file %s (%s)",
fprintf(stderr, "Unable to create index for input file %s (%s)",
options->infile_extra->name,grib_get_error_message(ret));
exit(ret);
}