Is there something like startsWith(str_a, str_b) in the standard C library?
startsWith(str_a, str_b)
It should take pointers to two strings that end with nullbytes, and tell me
Optimized (v.2. - corrected):
uint32 startsWith( const void* prefix_, const void* str_ ) { uint8 _cp, _cs; const uint8* _pr = (uint8*) prefix_; const uint8* _str = (uint8*) str_; while ( ( _cs = *_str++ ) & ( _cp = *_pr++ ) ) { if ( _cp != _cs ) return 0; } return !_cp; }