X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fyokogawa-dlm%2Fprotocol.c;h=7d6c7e9452acb749302f8b5c0f26b35cf91519c9;hb=5ec172d7e9ed55537b6a152a6b8e98712a2f595e;hp=185f9d5c4b7b4944150c70d6a0dbc9a568fb2c49;hpb=b18b8a92028475ca3d9ab33c06248d37075837be;p=libsigrok.git diff --git a/src/hardware/yokogawa-dlm/protocol.c b/src/hardware/yokogawa-dlm/protocol.c index 185f9d5c..7d6c7e94 100644 --- a/src/hardware/yokogawa-dlm/protocol.c +++ b/src/hardware/yokogawa-dlm/protocol.c @@ -372,7 +372,8 @@ static int array_option_get(char *value, const char *(*array)[], static int array_float_get(gchar *value, const uint64_t array[][2], int array_len, int *result) { - int i, pos, e; + int i, e; + size_t pos; uint64_t f; float s; unsigned int s_int; @@ -382,8 +383,7 @@ static int array_float_get(gchar *value, const uint64_t array[][2], memset(es, 0, sizeof(es)); /* Get index of the separating 'E' character and break up the string. */ - pos = (int)g_strstr_len(value, strlen(value), "E"); - pos -= (int)value; + pos = strcspn(value, "E"); strncpy(ss, value, pos); strncpy(es, &(value[pos+1]), 3); @@ -1166,7 +1166,7 @@ SR_PRIV int dlm_data_receive(int fd, int revents, void *cb_data) * As of now we only support importing the current acquisition * data so we're going to stop at this point. */ - sdi->driver->dev_acquisition_stop(sdi, cb_data); + sdi->driver->dev_acquisition_stop(sdi); return TRUE; } else devc->current_channel = devc->current_channel->next;