diff --git a/websocketpp/logger/basic.hpp b/websocketpp/logger/basic.hpp index 144a00dd19..6a5d6cd1d0 100644 --- a/websocketpp/logger/basic.hpp +++ b/websocketpp/logger/basic.hpp @@ -111,15 +111,17 @@ private: typedef typename concurrency::scoped_lock_type scoped_lock_type; typedef typename concurrency::mutex_type mutex_type; - const char* get_timestamp() { + // The timestamp does not include the time zone, because on Windows with the default registry settings, + // the time zone would be written out in full, which would be obnoxiously verbose. + std::string get_timestamp() { std::time_t t = std::time(NULL); - std::strftime(buffer,39,"%Y-%m-%d %H:%M:%S%z",std::localtime(&t)); + char buffer[40]; + std::strftime(buffer,sizeof(buffer),"%Y-%m-%d %H:%M:%S",std::localtime(&t)); return buffer; } mutex_type m_lock; - char buffer[40]; const level m_static_channels; level m_dynamic_channels; std::ostream* m_out; diff --git a/websocketpp/processors/hybi00.hpp b/websocketpp/processors/hybi00.hpp index d40cbffe59..2b678438a7 100644 --- a/websocketpp/processors/hybi00.hpp +++ b/websocketpp/processors/hybi00.hpp @@ -338,8 +338,8 @@ public: } std::string val; - val.append(1,0xff); - val.append(1,0x00); + val.append(1,'\xff'); + val.append(1,'\x00'); out->set_payload(val); out->set_prepared(true); diff --git a/websocketpp/sha1/sha1.hpp b/websocketpp/sha1/sha1.hpp index 931f9ddd16..b5db4ac09a 100755 --- a/websocketpp/sha1/sha1.hpp +++ b/websocketpp/sha1/sha1.hpp @@ -102,7 +102,14 @@ class SHA1 while(length-- && !Corrupted) { +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(suppress: 6386) // Suppresses Visual Studio code analysis for write overrun. It doesn't know the index into Message_Block is protected by checking length. +#endif Message_Block[Message_Block_Index++] = (*message_array & 0xFF); +#ifdef _MSC_VER +#pragma warning(pop) +#endif Length_Low += 8; Length_Low &= 0xFFFFFFFF; // Force it to 32 bits