Skip to content

Commit

Permalink
Check time validity
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Feb 23, 2025
1 parent ab29c5f commit f0ba79c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/accessor/grib_accessor_class_time.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ int grib_accessor_time_t::pack_long(const long* val, size_t* len)
if (*len != 1)
return GRIB_WRONG_ARRAY_SIZE;

hour = v / 100;
minute = v % 100;
second = 0; /* We ignore the 'seconds' in our time calculation! */

if (!is_time_valid(v)) {
// ECC-1777: For now just a warning. Will later change to an error
fprintf(stderr, "ECCODES WARNING : %s:%s: Time is not valid! hour=%ld min=%ld sec=%ld\n",
class_name_, __func__, hour, minute, second);
// return GRIB_ENCODING_ERROR;
}

hour = v / 100;
minute = v % 100;
second = 0; /* We ignore the 'seconds' in our time calculation! */

if ((ret = grib_set_long_internal(hand, hour_, hour)) != GRIB_SUCCESS)
return ret;
if ((ret = grib_set_long_internal(hand, minute_, minute)) != GRIB_SUCCESS)
Expand Down

0 comments on commit f0ba79c

Please sign in to comment.