--- 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);
}