From a195939cdaca343013d32ae902839ffdb28c33cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 23 Aug 2016 20:47:05 +0200 Subject: =?UTF-8?q?Don't=20use=20put=5Ftime()=20because=20it=E2=80=99s=20n?= =?UTF-8?q?ot=20in=20gcc=204.9,=20in=20shitty-debian=20=E2=80=9Cstable?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use strftime instead --- louloulibs/xmpp/xmpp_component.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'louloulibs') diff --git a/louloulibs/xmpp/xmpp_component.cpp b/louloulibs/xmpp/xmpp_component.cpp index 22121f6..46c070a 100644 --- a/louloulibs/xmpp/xmpp_component.cpp +++ b/louloulibs/xmpp/xmpp_component.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #ifdef SYSTEMD_FOUND @@ -446,9 +445,10 @@ void XmppComponent::send_history_message(const std::string& muc_name, const std: XmlNode delay("delay"); delay["xmlns"] = "urn:xmpp:delay"; delay["from"] = muc_name + "@" + this->served_hostname; - std::stringstream date_ss; - date_ss << std::put_time(std::gmtime(×tamp), "%FT%Tz") << std::endl; - delay["stamp"] = date_ss.str(); + constexpr std::size_t stamp_size = 20; + char date_buf[stamp_size]; + std::strftime(date_buf, stamp_size, "%FT%Tz", std::gmtime(×tamp)); + delay["stamp"] = date_buf; message.add_child(std::move(delay)); this->send_stanza(message); -- cgit v1.2.3