aboutsummaryrefslogtreecommitdiffstats
path: root/include/lv2/atom/forge.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lv2/atom/forge.h')
-rw-r--r--include/lv2/atom/forge.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/lv2/atom/forge.h b/include/lv2/atom/forge.h
index 5110b99..5656079 100644
--- a/include/lv2/atom/forge.h
+++ b/include/lv2/atom/forge.h
@@ -316,11 +316,18 @@ lv2_atom_forge_write(LV2_Atom_Forge* forge, const void* data, uint32_t size)
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_string_body(LV2_Atom_Forge* forge, const char* str, uint32_t len)
{
- LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, str, len);
- if (out && (out = lv2_atom_forge_raw(forge, "", 1))) {
- lv2_atom_forge_pad(forge, len + 1);
+ const LV2_Atom_Forge_Ref s = lv2_atom_forge_raw(forge, str, len);
+ if (!s) {
+ return s;
}
- return out;
+
+ const LV2_Atom_Forge_Ref t = lv2_atom_forge_raw(forge, "", 1);
+ if (!t) {
+ return t;
+ }
+
+ lv2_atom_forge_pad(forge, len + 1U);
+ return t;
}
/**