]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use %pV when printing dates
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 11 Apr 2018 08:42:59 +0000 (14:42 +0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 11 Apr 2018 08:42:59 +0000 (14:42 +0600)
src/modules/rlm_expiration/rlm_expiration.c

index 0d257efa57271688fceb2313a97d135d20e2e0f1..ebaf406e3929fc05d252fe9fc7b0a3cf19da99c3 100644 (file)
@@ -38,7 +38,6 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(UNUSED void *instance, UNUSED
 
        check_item = fr_pair_find_by_num(request->control, 0, FR_EXPIRATION, TAG_ANY);
        if (check_item != NULL) {
-               char date[50];
                /*
                *      Has this user's password expired?
                *
@@ -47,15 +46,11 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(UNUSED void *instance, UNUSED
                *      why they're being rejected.
                */
                if (((time_t) check_item->vp_date) <= request->packet->timestamp.tv_sec) {
-                       fr_pair_value_snprint(date, sizeof(date), check_item, 0);
-                       REDEBUG("Account expired at '%s'", date);
+                       REDEBUG("Account expired at '%pV'", &check_item->data);
 
                        return RLM_MODULE_USERLOCK;
                } else {
-                       if (RDEBUG_ENABLED) {
-                               fr_pair_value_snprint(date, sizeof(date), check_item, 0);
-                               RDEBUG("Account will expire at '%s'", date);
-                       }
+                       if (RDEBUG_ENABLED) RDEBUG("Account will expire at '%pV'", &check_item->data);
                }
 
                /*