]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/beaglelogic/beaglelogic_tcp.c
Random whitespace/cosmetic/typo fixes.
[libsigrok.git] / src / hardware / beaglelogic / beaglelogic_tcp.c
index 24355240ceb89569ddd2749e55110c5da77aa4c7..9cf78bbf854630d7b9f9431fd269a81fddb04ed7 100644 (file)
@@ -112,7 +112,7 @@ static int beaglelogic_tcp_send_cmd(struct dev_context *devc,
        }
 
        if (out < (int)strlen(buf)) {
-               sr_dbg("Only sent %d/%lu bytes of command: '%s'.", out,
+               sr_dbg("Only sent %d/%zu bytes of command: '%s'.", out,
                       strlen(buf), buf);
        }
 
@@ -172,6 +172,7 @@ static int beaglelogic_tcp_get_string(struct dev_context *devc, const char *cmd,
        int len;
        gint64 timeout;
 
+       *tcp_resp = NULL;
        if (cmd) {
                if (beaglelogic_tcp_send_cmd(devc, cmd) != SR_OK)
                        return SR_ERR;
@@ -288,9 +289,11 @@ static int beaglelogic_get_samplerate(struct dev_context *devc)
        int arg, err;
 
        err = beaglelogic_tcp_get_int(devc, "samplerate", &arg);
-       devc->cur_samplerate = arg;
+       if (err)
+               return err;
 
-       return err;
+       devc->cur_samplerate = arg;
+       return SR_OK;
 }
 
 static int beaglelogic_set_samplerate(struct dev_context *devc)