siglent-sds: Replace non-portable strcasestr() with g_strstr_len().
The strcasestr() function is non-portable (e.g. not available on MinGW, possibly elsewhere). Replace it with g_strstr_len() for the time being. While the latter is not case-insensitive it appears that that property doesn't matter here ("." should not be relevant anyway, and e.g. an SDS1202X-E does indeed report "Mpts" as such). Should it become necessary to have this code be case-insensitive, we'll have to find a more portable solution than strcasestr().
This commit is contained in:
parent
04fe775be6
commit
a9a38e7511
|
@ -684,10 +684,10 @@ SR_PRIV int siglent_sds_get_dev_cfg_horizontal(const struct sr_dev_inst *sdi)
|
|||
g_free(cmd);
|
||||
if (res != SR_OK)
|
||||
return SR_ERR;
|
||||
if (strcasestr(samplePointsString, "Mpts") != NULL) {
|
||||
if (g_strstr_len(samplePointsString, -1, "Mpts") != NULL) {
|
||||
samplePointsString[strlen(samplePointsString) - 4] = '\0';
|
||||
|
||||
if (strcasestr(samplePointsString, ".") != NULL) {
|
||||
if (g_strstr_len(samplePointsString, -1, ".") != NULL) {
|
||||
first = strtok(samplePointsString, ".");
|
||||
concat = strcat(first, strtok(NULL, "."));
|
||||
if (sr_atof_ascii(concat, &fvalue) != SR_OK || fvalue == 0.0) {
|
||||
|
|
Loading…
Reference in New Issue