summary refs log tree commit diff stats
path: root/plugins/fishlim/irc.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/fishlim/irc.c')
-rw-r--r--plugins/fishlim/irc.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/plugins/fishlim/irc.c b/plugins/fishlim/irc.c
index 3586921b..c80fc1c9 100644
--- a/plugins/fishlim/irc.c
+++ b/plugins/fishlim/irc.c
@@ -22,8 +22,7 @@
 
 */
 
-#include <stdlib.h>
-#include <string.h>
+#include <glib.h>
 #include "irc.h"
 
 /**
@@ -65,7 +64,6 @@ bool irc_parse_message(const char *words[],
  */
 char *irc_prefix_get_nick(const char *prefix) {
     const char *end;
-    char *nick;
     size_t length;
     
     if (!prefix) return NULL;
@@ -76,13 +74,7 @@ char *irc_prefix_get_nick(const char *prefix) {
     
     // Allocate string
     length = end - prefix;
-    nick = malloc(length+1);
-    if (!nick) return NULL;
-    
-    // Copy to string
-    memcpy(nick, prefix, length);
-    nick[length] = '\0';
-    return nick;
+    return g_strndup (prefix, length);
 }