Return SR_ERR_MALLOC for failed malloc, not SR_ERR.
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
break;
case SR_CONF_COUPLING:
- *data = g_variant_new_strv(coupling, ARRAY_SIZE(coupling));
- break;
+ *data = g_variant_new_strv(coupling, ARRAY_SIZE(coupling));
+ break;
case SR_CONF_VDIV:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
for (i = 0; i < ARRAY_SIZE(vdivs); i++) {
if (get_cfg(sdi, cmd, buf) != SR_OK)
return SR_ERR;
*f = strtof(buf, &e);
- if (e == buf || (fpclassify(*f) & (FP_ZERO|FP_NORMAL)) == 0) {
+ if (e == buf || (fpclassify(*f) & (FP_ZERO | FP_NORMAL)) == 0) {
sr_dbg("failed to parse response to '%s': '%s'", cmd, buf);
return SR_ERR;
}
{
if (!(*buf = g_try_malloc0(256)))
- return SR_ERR;
+ return SR_ERR_MALLOC;
if (get_cfg(sdi, cmd, *buf) != SR_OK)
return SR_ERR;