cwCommonImpl.h/cpp : Added #include <ccytpe>. Check for null label in labelToId()

This commit is contained in:
kevin 2023-07-25 20:22:44 -04:00
parent 7e6ab875c9
commit 39599e3e2e
2 changed files with 7 additions and 4 deletions

View File

@ -28,6 +28,8 @@ const char* cw::idToLabel( const idLabelPair_t* array, unsigned id, unsigned eol
unsigned cw::labelToId( const idLabelPair_t* array, const char* label, unsigned eolId )
{
const idLabelPair_t* p = array;
if( label != nullptr )
for(; p->id != eolId; ++p)
if( std::strcmp(label,p->label) == 0 )
return p->id;

View File

@ -17,6 +17,7 @@
#include <atomic>
#include <cstdint>
#include <cmath>
#include <cctype>
#include <complex>
#include <type_traits>