4853. [bug] Add REQUIRE's and INSIST's to isc_time_formatISO8601L
and isc_time_formatISO8601Lms. [RT #46916]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user