pluto: Print expiry time more properly.
This commit is contained in:
+3
-2
@@ -16,6 +16,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -124,8 +125,8 @@ check_expiry(time_t expiration_date, int warning_interval, bool strict)
|
|||||||
time_left /= 60;
|
time_left /= 60;
|
||||||
unit = "minute";
|
unit = "minute";
|
||||||
}
|
}
|
||||||
snprintf(buf, 35, "warning (expires in %d %s%s)", time_left,
|
snprintf(buf, 35, "warning (expires in %" PRIu64 " %s%s)",
|
||||||
unit, (time_left == 1)?"":"s");
|
(u_int64_t)time_left, unit, (time_left == 1) ? "" : "s");
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user