Fix Y2K38 bug

Fixed a bug which caused Article::get_metadata() to read timestamps as
32-bit integers, causing issues with timestamps after 2038.
This commit is contained in:
luca0N! 2022-04-25 22:53:42 -03:00
parent 61a0513ad0
commit 1e8660fb86
Signed by: luca0N
GPG Key ID: 2E7B4655CF16D7D6
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ namespace Article {
else if (line.find(k_authors) == 0)
strncpy(m->authors, line.substr(k_authors.length()).c_str(), sizeof(m->authors));
else if (line.find(k_published) == 0)
m->publish_ts = atoi(line.substr(k_published.length()).c_str());
m->publish_ts = atol(line.substr(k_published.length()).c_str());
else
std::cerr << "warning: ignoring unknown key/value due to unknown key: " << line << std::endl;
} else if (line[0] == '[') {