src/main.c
changeset 49 59b09b0aeb96
parent 47 a689b6a8e6ed
child 54 e21f837e2b13
--- a/src/main.c
+++ b/src/main.c
@@ -16,6 +16,8 @@
 #include <config.h>
 #include "common.h"
 
+#include <compat.h>
+
 #ifndef CONFIG_FILE
 #define CONFIG_FILE "/var/lib/mcbot/.mcbotrc"
 #endif
@@ -86,7 +88,7 @@
 
     if (uc.channel) {
         fprintf (message.stream, "JOIN :%s\r\n", uc.channel);
-        strncpy (message.current_channel, uc.channel, 40);
+        safe_strncpy (message.current_channel, uc.channel, sizeof (message.current_channel));
         if (uc.topic)
             fprintf (message.stream, "TOPIC %s :%s\r\n", uc.channel, uc.topic);
     }