Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix formating of expire time

  • Loading branch information...
commit def380f9fd94d648d7a710defcf9df8796288d8d 1 parent 24ddf4a
@toffaletti authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 keygen.hh
View
6 keygen.hh
@@ -30,7 +30,11 @@ struct meta_t {
} __attribute__((packed));
std::ostream &operator <<(std::ostream &o, const meta_t &m) {
- o << "{org_id:" << m.org_id << ",app_id:" << m.app_id << ",expires:" << ctime((time_t *)&m.expires);
+ struct tm tm = {};
+ localtime_r((time_t *)&m.expires, &tm);
+ char buf[128];
+ strftime(buf, sizeof(buf), "%c", &tm);
+ o << "{org_id:" << m.org_id << ",app_id:" << m.app_id << ",expires:" << buf;
o << ",flags:" << m.flags << ",credits:" << m.credits << "}";
return o;
}
Please sign in to comment.
Something went wrong with that request. Please try again.