Commit f9b5dba7 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Fix implicit conversion in gribapiGetTimeUnits.

parent 14f814eb
......@@ -193,18 +193,17 @@ int gribapiGetEndStep(grib_handle *gh, int startStep, int timeunits)
{
int endStep = startStep;
int timeunits2 = timeunits;
int status;
long unitsOfTime;
long lpar;
status = grib_get_long(gh, "stepUnits", &unitsOfTime);
long unitsOfTime;
int status = grib_get_long(gh, "stepUnits", &unitsOfTime);
if ( status == 0 ) timeunits2 = getTimeunits(unitsOfTime);
//timeunits2 = gribapiGetTimeUnits(gh);
long lpar;
status = grib_get_long(gh, "endStep", &lpar);
if ( status == 0 )
endStep = (int) ((lpar * timeunit_factor(timeunits, timeunits2)) + 0.5);
endStep = (int) (((double)lpar * timeunit_factor(timeunits, timeunits2)) + 0.5);
// printf("%d %d %d %d %d %g\n", startStep, endStep, lpar, timeunits, timeunits2, timeunit_factor(timeunits, timeunits2));
return (endStep);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment