about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-08-04 17:20:46 +0100
committerJames Booth <boothj5@gmail.com>2013-08-04 17:20:46 +0100
commit3588a9d7761669f6d1c6776a07cc0555afd4b084 (patch)
tree7a1d204a8d2fcc4f3b0ac7f5278b978446c54ad5 /src/ui
parent87c627710906171b3696e65fac985bd50c43c6f3 (diff)
parent20dff5fe2f0251d39a1667b547a49cef3b115899 (diff)
downloadprofani-tty-3588a9d7761669f6d1c6776a07cc0555afd4b084.tar.gz
Merge remote-tracking branch 'dmitry/nextdev-patches' into nextdev
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c2
-rw-r--r--src/ui/core.c5
-rw-r--r--src/ui/notifier.c6
-rw-r--r--src/ui/statusbar.c2
-rw-r--r--src/ui/titlebar.c10
5 files changed, 13 insertions, 12 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 50d2b649..6efc1cf1 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -784,7 +784,7 @@ cons_show_room_invite(const char * const invitor, const char * const room,
         notify_invite(display_from, room, reason);
     }
 
-    FREE_SET_NULL(display_from);
+    free(display_from);
 
     ui_console_dirty();
     cons_alert();
diff --git a/src/ui/core.c b/src/ui/core.c
index 83839952..b33186ec 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -293,8 +293,9 @@ ui_incoming_msg(const char * const from, const char * const message,
     GTimeVal *tv_stamp, gboolean priv)
 {
     gboolean win_created = FALSE;
-    char *display_from;
+    char *display_from = NULL;
     win_type_t win_type;
+
     if (priv) {
         win_type = WIN_PRIVATE;
         display_from = get_nick_from_full_jid(from);
@@ -438,7 +439,7 @@ ui_incoming_msg(const char * const from, const char * const message,
     if (prefs_get_boolean(PREF_NOTIFY_MESSAGE))
         notify_message(display_from, ui_index);
 
-    FREE_SET_NULL(display_from);
+    free(display_from);
 }
 
 void
diff --git a/src/ui/notifier.c b/src/ui/notifier.c
index f43c8c25..403c215e 100644
--- a/src/ui/notifier.c
+++ b/src/ui/notifier.c
@@ -80,7 +80,7 @@ notify_invite(const char * const from, const char * const room,
 
     _notify(message->str, 10000, "Incoming message");
 
-    g_string_free(message, FALSE);
+    g_string_free(message, TRUE);
 }
 
 void
@@ -102,7 +102,7 @@ notify_room_message(const char * const handle, const char * const room, int win)
 
     _notify(text->str, 10000, "incoming message");
 
-    g_string_free(text, FALSE);
+    g_string_free(text, TRUE);
 }
 
 void
@@ -111,7 +111,7 @@ notify_subscription(const char * const from)
     GString *message = g_string_new("Subscription request: \n");
     g_string_append(message, from);
     _notify(message->str, 10000, "Incomming message");
-    g_string_free(message, FALSE);
+    g_string_free(message, TRUE);
 }
 
 void
diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c
index 3f0798d3..cd218e73 100644
--- a/src/ui/statusbar.c
+++ b/src/ui/statusbar.c
@@ -191,7 +191,7 @@ status_bar_print_message(const char * const msg)
 
     werase(status_bar);
 
-    message = (char *) malloc((strlen(msg) + 1) * sizeof(char));
+    message = (char *) malloc(strlen(msg) + 1);
     strcpy(message, msg);
     mvwprintw(status_bar, 0, 10, message);
 
diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c
index 4b3ca997..791a5fbe 100644
--- a/src/ui/titlebar.c
+++ b/src/ui/titlebar.c
@@ -87,7 +87,7 @@ title_bar_refresh(void)
                     free(current_title);
                 }
 
-                current_title = (char *) malloc((strlen(recipient) + 1) * sizeof(char));
+                current_title = (char *) malloc(strlen(recipient) + 1);
                 strcpy(current_title, recipient);
 
                 title_bar_draw();
@@ -113,7 +113,7 @@ title_bar_show(const char * const title)
     if (current_title != NULL)
         free(current_title);
 
-    current_title = (char *) malloc((strlen(title) + 1) * sizeof(char));
+    current_title = (char *) malloc(strlen(title) + 1);
     strcpy(current_title, title);
     _title_bar_draw_title();
 }
@@ -138,7 +138,7 @@ title_bar_set_recipient(const char * const from)
         free(current_title);
     }
 
-    current_title = (char *) malloc((strlen(from) + 1) * sizeof(char));
+    current_title = (char *) malloc(strlen(from) + 1);
     strcpy(current_title, from);
 
     dirty = TRUE;
@@ -160,10 +160,10 @@ title_bar_set_typing(gboolean is_typing)
     }
 
     if (is_typing) {
-        current_title = (char *) malloc((strlen(recipient) + 13) * sizeof(char));
+        current_title = (char *) malloc(strlen(recipient) + 13);
         sprintf(current_title, "%s (typing...)", recipient);
     } else {
-        current_title = (char *) malloc((strlen(recipient) + 1) * sizeof(char));
+        current_title = (char *) malloc(strlen(recipient) + 1);
         strcpy(current_title, recipient);
     }