replace strstr with str_contains

This commit is contained in:
MCUdude
2023-08-09 22:52:02 +02:00
parent e6b5fb3a77
commit 72597dbd16
3 changed files with 4 additions and 4 deletions

View File

@@ -669,7 +669,7 @@ static int buspirate_start_spi_mode_ascii(const PROGRAMMER *pgm) {
if (rcvd == NULL) {
return -1;
}
if (strstr(rcvd, "Normal (H=3.3V, L=GND)")) {
if (str_contains(rcvd, "Normal (H=3.3V, L=GND)")) {
/* BP firmware 2.1 defaults to Open-drain output.
* That doesn't work on my board, even with pull-up
* resistors. Select 3.3V output mode instead. */

View File

@@ -345,7 +345,7 @@ int dev_message(int msglvl, const char *fmt, ...) {
int dev_has_subsstr_comms(const LISTID comms, const char *subs) {
if(comms)
for(LNODEID ln=lfirst(comms); ln; ln=lnext(ln))
if(strstr((char *) ldata(ln), subs))
if(str_contains((char *) ldata(ln), subs))
return 1;
return 0;
}

View File

@@ -155,7 +155,7 @@ static int usbdev_open(const char *port, union pinfo pinfo, union filedescriptor
* whether we have to search for a HID interface
* below.
*/
if(strstr(product, "CMSIS-DAP") != NULL)
if(str_contains(product, "CMSIS-DAP"))
{
pinfo.usbinfo.flags |= PINFO_FL_USEHID;
/* The JTAGICE3 running the CMSIS-DAP firmware doesn't
@@ -163,7 +163,7 @@ static int usbdev_open(const char *port, union pinfo pinfo, union filedescriptor
fd->usb.eep = 0;
}
if(strstr(product, "mEDBG") != NULL)
if(str_contains(product, "mEDBG"))
{
/* The AVR Xplained Mini uses different endpoints. */
fd->usb.rep = 0x81;