Changeset fef7813
- Timestamp:
- 2010-09-05T11:31:22Z (14 years ago)
- Branches:
- master
- Children:
- ed320e8
- Parents:
- 41e0c00
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.c
r41e0c00 rfef7813 136 136 137 137 setsid(); 138 chdir( "/" ); 138 i = chdir( "/" ); 139 /* Don't use i, just make gcc happy. :-/ */ 139 140 140 141 if( getenv( "_BITLBEE_RESTART_STATE" ) == NULL ) -
help.c
r41e0c00 rfef7813 157 157 } 158 158 159 lseek( h->fd, h->offset.file_offset, SEEK_SET ); 160 read( h->fd, s, h->length ); 159 if( lseek( h->fd, h->offset.file_offset, SEEK_SET ) == -1 || 160 read( h->fd, s, h->length ) != h->length ) 161 return NULL; 161 162 } 162 163 else -
irc_send.c
r41e0c00 rfef7813 53 53 void irc_send_motd( irc_t *irc ) 54 54 { 55 char motd[2048]; 56 size_t len; 55 57 int fd; 56 58 57 59 fd = open( global.conf->motdfile, O_RDONLY ); 58 if( fd == -1 )60 if( fd == -1 || ( len = read( fd, motd, sizeof( motd ) - 1 ) ) <= 0 ) 59 61 { 60 62 irc_send_num( irc, 422, ":We don't need MOTDs." ); … … 62 64 else 63 65 { 64 char linebuf[80]; /* Max. line length for MOTD's is 79 chars. It's what most IRC networks seem to do. */ 65 char *add, max; 66 int len; 67 66 char linebuf[80]; 67 char *add, max, *in; 68 69 in = motd; 70 motd[len] = '\0'; 68 71 linebuf[79] = len = 0; 69 72 max = sizeof( linebuf ) - 1; 70 73 71 74 irc_send_num( irc, 375, ":- %s Message Of The Day - ", irc->root->host ); 72 while( read( fd, linebuf + len, 1 ) == 1)75 while( ( linebuf[len] = *(in++) ) ) 73 76 { 74 77 if( linebuf[len] == '\n' || len == max ) … … 80 83 else if( linebuf[len] == '%' ) 81 84 { 82 read( fd, linebuf + len, 1);85 linebuf[len] = *(in++); 83 86 if( linebuf[len] == 'h' ) 84 87 add = irc->root->host; … … 87 90 else if( linebuf[len] == 'n' ) 88 91 add = irc->user->nick; 92 else if( linebuf[len] == '\0' ) 93 in --; 89 94 else 90 95 add = "%"; … … 99 104 } 100 105 irc_send_num( irc, 376, ":End of MOTD" ); 106 } 107 108 if( fd != -1 ) 101 109 close( fd ); 102 }103 110 } 104 111 -
motd.txt
r41e0c00 rfef7813 17 17 18 18 ... Buzzing, haha, get it? 19 % -
protocols/oscar/ssi.c
r41e0c00 rfef7813 415 415 if (!parentgroup) { 416 416 char *newgroup; 417 newgroup = (char*)g_malloc(strlen("Unknown") *sizeof(char));417 newgroup = (char*)g_malloc(strlen("Unknown")+1); 418 418 strcpy(newgroup, "Unknown"); 419 419 aim_ssi_addgroups(sess, conn, &newgroup, 1); -
unix.c
r41e0c00 rfef7813 167 167 doesn't make a copy. Odd. */ 168 168 169 chdir( old_cwd );169 i = chdir( old_cwd ); 170 170 close( global.listen_socket ); 171 171
Note: See TracChangeset
for help on using the changeset viewer.