src/main.c
changeset 49 59b09b0aeb96
parent 47 a689b6a8e6ed
child 54 e21f837e2b13
equal deleted inserted replaced
48:34094173351c 49:59b09b0aeb96
    13 #include <libintl.h>
    13 #include <libintl.h>
    14 
    14 
    15 #include <mcbot.h>
    15 #include <mcbot.h>
    16 #include <config.h>
    16 #include <config.h>
    17 #include "common.h"
    17 #include "common.h"
       
    18 
       
    19 #include <compat.h>
    18 
    20 
    19 #ifndef CONFIG_FILE
    21 #ifndef CONFIG_FILE
    20 #define CONFIG_FILE "/var/lib/mcbot/.mcbotrc"
    22 #define CONFIG_FILE "/var/lib/mcbot/.mcbotrc"
    21 #endif
    23 #endif
    22 
    24 
    84 
    86 
    85     signal (SIGTERM, sigproc);
    87     signal (SIGTERM, sigproc);
    86 
    88 
    87     if (uc.channel) {
    89     if (uc.channel) {
    88         fprintf (message.stream, "JOIN :%s\r\n", uc.channel);
    90         fprintf (message.stream, "JOIN :%s\r\n", uc.channel);
    89         strncpy (message.current_channel, uc.channel, 40);
    91         safe_strncpy (message.current_channel, uc.channel, sizeof (message.current_channel));
    90         if (uc.topic)
    92         if (uc.topic)
    91             fprintf (message.stream, "TOPIC %s :%s\r\n", uc.channel, uc.topic);
    93             fprintf (message.stream, "TOPIC %s :%s\r\n", uc.channel, uc.topic);
    92     }
    94     }
    93 
    95 
    94     while (!feof (message.stream)) {
    96     while (!feof (message.stream)) {