diff --git a/include/cereal/archives/json.hpp b/include/cereal/archives/json.hpp index f86bcd40..564eebf2 100644 --- a/include/cereal/archives/json.hpp +++ b/include/cereal/archives/json.hpp @@ -539,13 +539,11 @@ namespace cereal /*! @throws Exception if no such named node exists */ inline void search( const char * searchName ) { - const auto len = std::strlen( searchName ); size_t index = 0; for( auto it = itsMemberItBegin; it != itsMemberItEnd; ++it, ++index ) { const auto currentName = it->name.GetString(); - if( ( std::strncmp( searchName, currentName, len ) == 0 ) && - ( std::strlen( currentName ) == len ) ) + if( std::strcmp( searchName, currentName ) == 0 ) { itsIndex = index; return;