From: Josh Soref Date: Sun, 13 Jun 2021 21:31:58 +0000 (-0400) Subject: spelling: arithmetics X-Git-Tag: 1.8.0-rc.1~25^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=041bbd3c582c7358faff480c7fb53071cb308876;p=thirdparty%2Fldns.git spelling: arithmetics Signed-off-by: Josh Soref --- diff --git a/examples/ldns-rrsig.c b/examples/ldns-rrsig.c index 78b55b91..9b7aac43 100644 --- a/examples/ldns-rrsig.c +++ b/examples/ldns-rrsig.c @@ -180,7 +180,7 @@ main(int argc, char *argv[]) for(i = 0; i < ldns_rr_list_rr_count(rrsig_type); i++) { memset(&incep, 0, sizeof(incep)); - if (ldns_serial_arithmitics_gmtime_r( + if (ldns_serial_arithmetics_gmtime_r( ldns_rdf2native_time_t( ldns_rr_rrsig_inception( ldns_rr_list_rr(rrsig_type, i))), @@ -192,7 +192,7 @@ main(int argc, char *argv[]) incep_buf[0] = '\0'; } memset(&expir, 0, sizeof(expir)); - if (ldns_serial_arithmitics_gmtime_r( + if (ldns_serial_arithmetics_gmtime_r( ldns_rdf2native_time_t( ldns_rr_rrsig_expiration( ldns_rr_list_rr(rrsig_type, i))), diff --git a/host2str.c b/host2str.c index f8ff966f..3765bcb4 100644 --- a/host2str.c +++ b/host2str.c @@ -418,7 +418,7 @@ ldns_rdf2buffer_str_time(ldns_buffer *output, const ldns_rdf *rdf) char date_buf[16]; memset(&tm, 0, sizeof(tm)); - if (ldns_serial_arithmitics_gmtime_r(ldns_rdf2native_int32(rdf), time(NULL), &tm) + if (ldns_serial_arithmetics_gmtime_r(ldns_rdf2native_int32(rdf), time(NULL), &tm) && strftime(date_buf, 15, "%Y%m%d%H%M%S", &tm)) { ldns_buffer_printf(output, "%s", date_buf); } diff --git a/ldns/util.h.in b/ldns/util.h.in index 514fcf3b..f02a3900 100644 --- a/ldns/util.h.in +++ b/ldns/util.h.in @@ -274,19 +274,19 @@ time_t mktime_from_utc(const struct tm *tm); /** * The function interprets time as the number of seconds since epoch - * with respect to now using serial arithmitics (rfc1982). + * with respect to now using serial arithmetics (rfc1982). * That number of seconds is then converted to broken-out time information. * This is especially useful when converting the inception and expiration * fields of RRSIG records. * * \param[in] time number of seconds since epoch (midnight, January 1st, 1970) - * to be intepreted as a serial arithmitics number relative to now. + * to be intepreted as a serial arithmetics number relative to now. * \param[in] now number of seconds since epoch (midnight, January 1st, 1970) * to which the time value is compared to determine the final value. * \param[out] result the struct with the broken-out time information * \return result on success or NULL on error */ -struct tm * ldns_serial_arithmitics_gmtime_r(int32_t time, time_t now, struct tm *result); +struct tm * ldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result); /** * Seed the random function. diff --git a/util.c b/util.c index 073bcaf1..b622f3fe 100644 --- a/util.c +++ b/util.c @@ -293,7 +293,7 @@ ldns_gmtime64_r(int64_t clock, struct tm *result) #endif /* SIZEOF_TIME_T <= 4 */ static int64_t -ldns_serial_arithmitics_time(int32_t time, time_t now) +ldns_serial_arithmetics_time(int32_t time, time_t now) { /* Casting due to https://github.com/NLnetLabs/ldns/issues/71 */ int32_t offset = (int32_t) ((uint32_t) time - (uint32_t) now); @@ -301,13 +301,13 @@ ldns_serial_arithmitics_time(int32_t time, time_t now) } struct tm * -ldns_serial_arithmitics_gmtime_r(int32_t time, time_t now, struct tm *result) +ldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result) { #if SIZEOF_TIME_T <= 4 - int64_t secs_since_epoch = ldns_serial_arithmitics_time(time, now); + int64_t secs_since_epoch = ldns_serial_arithmetics_time(time, now); return ldns_gmtime64_r(secs_since_epoch, result); #else - time_t secs_since_epoch = ldns_serial_arithmitics_time(time, now); + time_t secs_since_epoch = ldns_serial_arithmetics_time(time, now); return gmtime_r(&secs_since_epoch, result); #endif }