diff options
author | Lukasz Skalski <l.skalski@partner.samsung.com> | 2013-12-09 14:09:25 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-09 23:27:19 -0500 |
commit | f7e2bd5a8070ba86cba6bcbf7d1c9a8173d846d4 (patch) | |
tree | dcb3ed2b03e2d98a663adadc52a1de6c09e50d76 /src/libsystemd-bus/bus-message.c | |
parent | d838db0d3b1369639ed7572f4f838eda58b8d858 (diff) |
libsystemd-bus: use assert_return
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 9e712717cc..5e355127b0 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -161,9 +161,7 @@ static void *message_extend_fields(sd_bus_message *m, size_t align, size_t sz, b size_t old_size, new_size, start; assert(m); - - if (m->poisoned) - return NULL; + assert_return(!m->poisoned, NULL); old_size = sizeof(struct bus_header) + m->header->fields_size; start = ALIGN_TO(old_size, align); @@ -989,9 +987,7 @@ struct bus_body_part *message_append_part(sd_bus_message *m) { struct bus_body_part *part; assert(m); - - if (m->poisoned) - return NULL; + assert_return(!m->poisoned, NULL); if (m->n_body_parts <= 0) { part = &m->body; @@ -1138,9 +1134,7 @@ static void *message_extend_body(sd_bus_message *m, size_t align, size_t sz, boo assert(m); assert(align > 0); assert(!m->sealed); - - if (m->poisoned) - return NULL; + assert_return(!m->poisoned, NULL); start_body = ALIGN_TO((size_t) m->header->body_size, align); end_body = start_body + sz; |