* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "sigrok-cli.h"
#include <glib.h>
#include <glib/gstdio.h>
#include <string.h>
#include <stdlib.h>
+#include "sigrok-cli.h"
static uint64_t limit_samples = 0;
static uint64_t limit_frames = 0;
}
} else if (config_key_has_cap(driver, sdi, NULL, SR_CONF_SAMPLERATE,
SR_CONF_GET | SR_CONF_SET)) {
- /* Convert to samples based on the samplerate. */
+ /* Convert to samples based on the samplerate. */
sr_config_get(driver, sdi, NULL, SR_CONF_SAMPLERATE, &gvar);
samplerate = g_variant_get_uint64(gvar);
g_variant_unref(gvar);
driver = sr_dev_inst_driver_get(sdi);
/* If the first packet to come in isn't a header, don't even try. */
- if (packet->type != SR_DF_HEADER && o == NULL)
+ if (packet->type != SR_DF_HEADER && !o)
return;
session = cb_data;
if (o) {
sr_output_free(o);
- if (srzip_and_filename)
- g_free(srzip_and_filename);
+ g_free(srzip_and_filename);
}
o = NULL;
}
src->key = srci->key;
- if ((value == NULL || strlen(value) == 0) &&
+ if ((!value || strlen(value) == 0) &&
(srci->datatype != SR_T_BOOL)) {
g_critical("Option '%s' needs a value.", (char *)key);
return -1;