about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-10-26 23:11:38 +0000
committerJames Booth <boothj5@gmail.com>2015-10-26 23:11:38 +0000
commit93c3feeacf090262ee24a8610f451a9196d92581 (patch)
tree468cfff405c1fba468823aad317e6f70d0de0fd7 /src
parent9d3bcf5f90af09eb073b1caf64ccfadaad599e4b (diff)
downloadprofani-tty-93c3feeacf090262ee24a8610f451a9196d92581.tar.gz
Add assert checks for ProfChatWin functions
Diffstat (limited to 'src')
-rw-r--r--src/ui/chatwin.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c
index 9af332a3..3b3d2e1c 100644
--- a/src/ui/chatwin.c
+++ b/src/ui/chatwin.c
@@ -34,6 +34,7 @@
 
 #include <string.h>
 #include <stdlib.h>
+#include <assert.h>
 
 #include "chat_session.h"
 #include "window_list.h"
@@ -49,6 +50,8 @@ static void _win_show_history(ProfChatWin *chatwin, const char *const contact);
 void
 ui_message_receipt(ProfChatWin *chatwin, const char *const id)
 {
+    assert(chatwin != NULL);
+
     ProfWin *win = (ProfWin*) chatwin;
     win_mark_received(win, id);
 }
@@ -56,6 +59,8 @@ ui_message_receipt(ProfChatWin *chatwin, const char *const id)
 void
 ui_gone_secure(ProfChatWin *chatwin, gboolean trusted)
 {
+    assert(chatwin != NULL);
+
     chatwin->is_otr = TRUE;
     chatwin->otr_is_trusted = trusted;
 
@@ -84,6 +89,8 @@ ui_gone_secure(ProfChatWin *chatwin, gboolean trusted)
 void
 ui_gone_insecure(ProfChatWin *chatwin)
 {
+    assert(chatwin != NULL);
+
     chatwin->is_otr = FALSE;
     chatwin->otr_is_trusted = FALSE;