The standard states that if a length is not given, the character array
must be nul-terminated.
static const char id3_sig[] = { 'I', 'D', '3' };
if(sig.size()<sizeof(id3_sig))
return false;
- return !sig.compare(0, sizeof(id3_sig), id3_sig);
+ return !sig.compare(0, sizeof(id3_sig), id3_sig, sizeof(id3_sig));
}
void Mp3Decoder::seek(unsigned pos)
static const char ogg_sig[] = { 'O', 'g', 'g', 'S' };
if(sig.size()<sizeof(ogg_sig))
return false;
- return !sig.compare(0, sizeof(ogg_sig), ogg_sig);
+ return !sig.compare(0, sizeof(ogg_sig), ogg_sig, sizeof(ogg_sig));
}
void OggDecoder::seek(unsigned pos)