diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-07-11 14:47:45 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-07-11 14:48:00 +0200 |
commit | 5692da47bef5402d37e131c1d55fbad864bd066d (patch) | |
tree | dc004a7daf95190fb2d28d548ec176f78924b91c /degesch.c | |
parent | c3d39dab5b0acdcd971e5365fb1967cbf243bcce (diff) | |
download | xK-5692da47bef5402d37e131c1d55fbad864bd066d.tar.gz xK-5692da47bef5402d37e131c1d55fbad864bd066d.tar.xz xK-5692da47bef5402d37e131c1d55fbad864bd066d.zip |
Fix various issues reported by Coverity
Diffstat (limited to 'degesch.c')
-rw-r--r-- | degesch.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -5003,7 +5003,10 @@ irc_handle_nick (struct server *s, const struct irc_message *msg) user_unref (buffer_collision->user); buffer_collision->user = user_ref (user); + } + if (pm_buffer && buffer_collision) + { // There's not much else we can do other than somehow try to merge // one buffer into the other. In our case, the original buffer wins. buffer_merge (s->ctx, buffer_collision, pm_buffer); @@ -6265,7 +6268,7 @@ static void config_dump_children (struct config_item_ *object, struct config_dump_data *data) { - hard_assert (object->type = CONFIG_ITEM_OBJECT); + hard_assert (object->type == CONFIG_ITEM_OBJECT); struct config_dump_level level; level.next = NULL; @@ -7788,6 +7791,7 @@ process_user_command struct command_handler *handler; if (!(handler = str_map_find (&map, command_name))) return false; + hard_assert (handler->flags == 0 || (handler->flags & HANDLER_SERVER)); if ((handler->flags & HANDLER_SERVER) && args.buffer->type == BUFFER_GLOBAL) @@ -8036,7 +8040,7 @@ static size_t utf8_common_prefix (const char **vector, size_t len) { size_t prefix = 0; - if (!vector || !vector[0]) + if (!vector || !len) return 0; struct utf8_iter a[len]; |