This makes " UTC" an illegal date specification.
assert(p);
assert(spec);
- if (isempty(p))
- return -EINVAL;
-
c = new0(CalendarSpec, 1);
if (!c)
return -ENOMEM;
}
}
+ if (isempty(p)) {
+ r = -EINVAL;
+ goto fail;
+ }
+
if (strcaseeq(p, "minutely")) {
r = const_chain(0, &c->microsecond);
if (r < 0)
test_next("Mon 2017-05~07/1 UTC", "", 12345, 1496016000000000);
assert_se(calendar_spec_from_string("test", &c) < 0);
+ assert_se(calendar_spec_from_string(" utc", &c) < 0);
assert_se(calendar_spec_from_string(" ", &c) < 0);
assert_se(calendar_spec_from_string("", &c) < 0);
assert_se(calendar_spec_from_string("7", &c) < 0);