Commit 0645f8f1 authored by Mark Andrews's avatar Mark Andrews
Browse files

4853. [bug] Add REQUIRE's and INSIST's to isc_time_formatISO8601L

                        and isc_time_formatISO8601Lms. [RT #46916]
parent 7770e0b0
4853. [bug] Add REQUIRE's and INSIST's to isc_time_formatISO8601L
and isc_time_formatISO8601Lms. [RT #46916]
4852. [bug] Handle strftime() failing in isc_time_formatISO8601ms.
Add REQUIRE's and INSIST's to isc_time_formattimestamp,
isc_time_formathttptimestamp, isc_time_formatISO8601,
......
......@@ -454,6 +454,9 @@ isc_time_formatISO8601L(const isc_time_t *t, char *buf, unsigned int len) {
struct tm tm;
#endif
REQUIRE(t != NULL);
INSIST(t->nanoseconds < NS_PER_S);
REQUIRE(buf != NULL);
REQUIRE(len > 0);
now = (time_t)t->seconds;
......@@ -473,6 +476,9 @@ isc_time_formatISO8601Lms(const isc_time_t *t, char *buf, unsigned int len) {
struct tm tm;
#endif
REQUIRE(t != NULL);
INSIST(t->nanoseconds < NS_PER_S);
REQUIRE(buf != NULL);
REQUIRE(len > 0);
now = (time_t)t->seconds;
......
......@@ -343,7 +343,10 @@ isc_time_formatISO8601L(const isc_time_t *t, char *buf, unsigned int len) {
/* strtime() format: "%Y-%m-%dT%H:%M:%S" */
REQUIRE(t != NULL);
REQUIRE(buf != NULL);
REQUIRE(len > 0);
if (FileTimeToSystemTime(&t->absolute, &st)) {
GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, "yyyy-MM-dd",
DateBuf, 50);
......@@ -364,7 +367,10 @@ isc_time_formatISO8601Lms(const isc_time_t *t, char *buf, unsigned int len) {
/* strtime() format: "%Y-%m-%dT%H:%M:%S.SSS" */
REQUIRE(t != NULL);
REQUIRE(buf != NULL);
REQUIRE(len > 0);
if (FileTimeToSystemTime(&t->absolute, &st)) {
GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, "yyyy-MM-dd",
DateBuf, 50);
......
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