Changeset b7fec48
- Timestamp:
- 2016-10-18T06:57:41Z (8 years ago)
- Branches:
- master
- Children:
- c94e208
- Parents:
- f95e606
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_send.c
rf95e606 rb7fec48 54 54 void irc_send_motd(irc_t *irc) 55 55 { 56 char motd[2048];57 s size_t len;58 int fd; 59 60 fd = open(global.conf->motdfile, O_RDONLY); 61 if ( fd == -1 || (len = read(fd, motd, sizeof(motd) - 1)) <= 0) {56 char *motd; 57 size_t len; 58 59 g_file_get_contents(global.conf->motdfile, &motd, &len, NULL); 60 61 if (!motd || !len) { 62 62 irc_send_num(irc, 422, ":We don't need MOTDs."); 63 63 } else { … … 66 66 67 67 in = motd; 68 motd[len] = '\0';69 68 linebuf[79] = len = 0; 70 69 max = sizeof(linebuf) - 1; … … 101 100 } 102 101 103 if (fd != -1) { 104 close(fd); 105 } 102 g_free(motd); 103 106 104 } 107 105
Note: See TracChangeset
for help on using the changeset viewer.