output/winmm: use StringStartsWith() instead of strstr()
This commit is contained in:
parent
cd08e5c7da
commit
cee3070ca4
@ -25,6 +25,7 @@
|
|||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
#include "util/Macros.hxx"
|
#include "util/Macros.hxx"
|
||||||
|
#include "util/StringUtil.hxx"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -109,7 +110,7 @@ get_device_id(const char *device_name, UINT *device_id, Error &error)
|
|||||||
continue;
|
continue;
|
||||||
/* szPname is only 32 chars long, so it is often truncated.
|
/* szPname is only 32 chars long, so it is often truncated.
|
||||||
Use partial match to work around this. */
|
Use partial match to work around this. */
|
||||||
if (strstr(device_name, caps.szPname) == device_name) {
|
if (StringStartsWith(device_name, caps.szPname)) {
|
||||||
*device_id = i;
|
*device_id = i;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user