diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fuzz/fuzz-calendarspec.c | 1 | ||||
-rw-r--r-- | src/shared/calendarspec.c | 8 | ||||
-rw-r--r-- | src/shared/calendarspec.h | 1 |
3 files changed, 2 insertions, 8 deletions
diff --git a/src/fuzz/fuzz-calendarspec.c b/src/fuzz/fuzz-calendarspec.c index 80801723fd..07d3fbca7f 100644 --- a/src/fuzz/fuzz-calendarspec.c +++ b/src/fuzz/fuzz-calendarspec.c @@ -16,7 +16,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (calendar_spec_from_string(str, &cspec) >= 0) { (void) calendar_spec_valid(cspec); - (void) calendar_spec_normalize(cspec); (void) calendar_spec_to_string(cspec, &p); } diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c index 7dfb50b98d..369cb2f081 100644 --- a/src/shared/calendarspec.c +++ b/src/shared/calendarspec.c @@ -145,7 +145,7 @@ static void fix_year(CalendarComponent *c) { } } -int calendar_spec_normalize(CalendarSpec *c) { +static void calendar_spec_normalize(CalendarSpec *c) { assert(c); if (streq_ptr(c->timezone, "UTC")) { @@ -167,8 +167,6 @@ int calendar_spec_normalize(CalendarSpec *c) { normalize_chain(&c->hour); normalize_chain(&c->minute); normalize_chain(&c->microsecond); - - return 0; } static bool chain_valid(CalendarComponent *c, int from, int to, bool end_of_month) { @@ -1086,9 +1084,7 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) { return -EINVAL; } - r = calendar_spec_normalize(c); - if (r < 0) - return r; + calendar_spec_normalize(c); if (!calendar_spec_valid(c)) return -EINVAL; diff --git a/src/shared/calendarspec.h b/src/shared/calendarspec.h index 3bfe82d7f6..d756efcdb7 100644 --- a/src/shared/calendarspec.h +++ b/src/shared/calendarspec.h @@ -35,7 +35,6 @@ typedef struct CalendarSpec { CalendarSpec* calendar_spec_free(CalendarSpec *c); -int calendar_spec_normalize(CalendarSpec *spec); bool calendar_spec_valid(CalendarSpec *spec); int calendar_spec_to_string(const CalendarSpec *spec, char **p); |