From 5dfe48b043dbcbf18edc08cb3577af186738732b Mon Sep 17 00:00:00 2001 From: Norbert Nemec Date: Tue, 9 Oct 2012 13:29:09 +0200 Subject: [PATCH] Fix Compiler Warning on using std::copy: no point using STL routines inside low-level C-style code --- src/processors/hybi_legacy.hpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/processors/hybi_legacy.hpp b/src/processors/hybi_legacy.hpp index 836d0ee727..c08c615f05 100644 --- a/src/processors/hybi_legacy.hpp +++ b/src/processors/hybi_legacy.hpp @@ -79,9 +79,7 @@ public: // TODO: decide if it is best to silently fail here or produce some sort // of warning or exception. const std::string& key3 = request.header("Sec-WebSocket-Key3"); - std::copy(key3.c_str(), - key3.c_str()+std::min(static_cast(8), key3.size()), - &key_final[8]); + memcpy(&key_final[8],key3.c_str(),std::min(static_cast(8), key3.size())); m_key3 = md5_hash_string(std::string(key_final,16)); @@ -331,11 +329,9 @@ private: num = atoi(digits.c_str()); if (spaces > 0 && num > 0) { num = htonl(num/spaces); - std::copy(reinterpret_cast(&num), - reinterpret_cast(&num)+4, - result); + memcpy(result,&num,4); } else { - std::fill(result,result+4,0); + memset(result,0,4); } }