diff --git a/src/alert.cpp b/src/alert.cpp index f20dde260..9f8ed8a93 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -1146,7 +1146,7 @@ namespace { std::string portmap_log_alert::message() const { - char ret[600]; + char ret[1024]; std::snprintf(ret, sizeof(ret), "%s: %s" , nat_type_str[static_cast(map_transport)] , log_message()); diff --git a/src/natpmp.cpp b/src/natpmp.cpp index da29a6e84..fd6760a52 100644 --- a/src/natpmp.cpp +++ b/src/natpmp.cpp @@ -285,7 +285,9 @@ void natpmp::mapping_log(char const* op, mapping_t const& m) const , m.external_port , m.local_port , to_string(m.act) - , total_seconds(m.expires - aux::time_now())); + , (m.expires.time_since_epoch() != seconds(0)) + ? total_seconds(m.expires - aux::time_now()) + : std::int64_t(0)); } }