Use memcmp, rather than strncmp, in wavplay's validate_wav_header(),
and avoid warnings about mismatched signedness. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@311 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -46,13 +46,13 @@ char *validate_wav_header(char *header)
|
||||
{
|
||||
Wave_Header *w = (Wave_Header *)header;
|
||||
|
||||
if (strncmp(w->riffID, WAV_RIFF_MAGIC, 4))
|
||||
if (memcmp(w->riffID, WAV_RIFF_MAGIC, 4))
|
||||
return NULL;
|
||||
|
||||
if (strncmp(w->waveID, WAV_WAVE_MAGIC, 4))
|
||||
if (memcmp(w->waveID, WAV_WAVE_MAGIC, 4))
|
||||
return NULL;
|
||||
|
||||
if (strncmp(w->fmtID, WAV_FMT_MAGIC, 4))
|
||||
if (memcmp(w->fmtID, WAV_FMT_MAGIC, 4))
|
||||
return NULL;
|
||||
|
||||
if (w->fmtsize != 16)
|
||||
@@ -66,7 +66,7 @@ Wave_Header *w = (Wave_Header *)header;
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
if (strncmp(w->dataID, WAV_DATA_MAGIC, 4))
|
||||
if (memcmp(w->dataID, WAV_DATA_MAGIC, 4))
|
||||
return(NULL);
|
||||
return (header + sizeof(Wave_Header));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user