[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/modules/irc irc.c,1.16,1.17
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/modules/irc irc.c,1.16,1.17 |
Date: |
Tue, 25 Mar 2003 19:04:00 -0500 |
Update of /cvsroot/ayttm/ayttm/modules/irc
In directory subversions:/tmp/cvs-serv22200/modules/irc
Modified Files:
irc.c
Log Message:
same for irc
Index: irc.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/irc/irc.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- irc.c 24 Mar 2003 23:46:39 -0000 1.16
+++ irc.c 26 Mar 2003 00:03:58 -0000 1.17
@@ -355,8 +355,8 @@
if ((*(buff2[2]) == '#') || (*(buff2[2]) == '&') || (*(buff2[2]) ==
'+') || (*(buff2[2]) == '!')) {
eb_chat_room * ecr = NULL;
strncpy(tempstring, buff2[2], BUF_LEN/2);
- strcat (tempstring, "@");
- strcat (tempstring, ila->server);
+ strncat (tempstring, "@",
sizeof(tempstring)-strlen(tempstring));
+ strncat (tempstring, ila->server,
sizeof(tempstring)-strlen(tempstring));
g_strdown(tempstring);
ecr = find_chat_room_by_id(tempstring);
if (ecr) {
@@ -384,10 +384,10 @@
is_nickserv = 1;
}
- strcpy(orig_nick, nick);
+ strncpy(orig_nick, nick, sizeof(orig_nick));
/* Add our internal @ircserver part */
- strcat(nick, "@");
+ strncat(nick, "@", 255-strlen(nick));
strncat(nick, ila->server, 255 - strlen(nick));
/* ... and search for the sender */
@@ -500,7 +500,7 @@
g_strfreev (buff2);
/* Add our internal @ircserver part */
- strcat(nick, "@");
+ strncat(nick, "@", 255-strlen(nick));
strncat(nick, ila->server, 255 - strlen(nick));
/* Search and set offline */
@@ -529,7 +529,7 @@
g_strfreev (buff2);
/* Add our internal @ircserver part */
- strcat(nick, "@");
+ strncat(nick, "@", 255-strlen(nick));
strncat(nick, ila->server, 255 - strlen(nick));
/* Search and set online */
@@ -551,7 +551,7 @@
if (ii->whois_info != NULL) {
free(ii->whois_info); }
ii->whois_info = malloc(BUF_LEN);
- strcpy(ii->whois_info, priv_split_buff[3]);
+ strncpy(ii->whois_info, priv_split_buff[3],
sizeof(ii->whois_info));
g_strfreev (priv_split_buff);
irc_info_update(ea->infowindow);
@@ -568,7 +568,7 @@
strncpy(nick, buff2[3], 100);
/* Add our internal @ircserver part */
- strcat(nick, "@");
+ strncat(nick, "@", 255-strlen(nick));
strncat(nick, ila->server, 255 - strlen(nick));
/* Search and set idle time */
@@ -595,7 +595,7 @@
buff2 = g_strsplit(buff, " ", 5);
strncpy(nick, buff2[3], 100);
/* Add our internal @ircserver part */
- strcat(nick, "@");
+ strncat(nick, "@", 255-strlen(nick));
strncat(nick, ila->server, 255 - strlen(nick));
/* Search and set realserver */
@@ -622,7 +622,7 @@
g_strfreev (buff2);
/* Add our internal @ircserver part */
- strcat(nick, "@");
+ strncat(nick, "@", 255-strlen(nick));
strncat(nick, ila->server, 255 - strlen(nick));
/* Search and set online */
@@ -657,9 +657,9 @@
int i = 6;
g_strchomp(buff);
buff2 = g_strsplit(buff, " ", -1);
- strcpy(tempstring, buff2[4]);
- strcat(tempstring, "@");
- strcat(tempstring, ila->server);
+ strncpy(tempstring, buff2[4], BUF_LEN);
+ strncat(tempstring, "@", BUF_LEN-strlen(tempstring));
+ strncat(tempstring, ila->server, BUF_LEN-strlen(tempstring));
g_strdown(tempstring);
ecr = find_chat_room_by_id(tempstring);
if (ecr) {
@@ -693,9 +693,9 @@
buff2 = g_strsplit(buff, " ", 3);
g_strchomp(buff2[2]);
- strcpy(tempstring, buff2[2]+1);
- strcat(tempstring, "@");
- strcat(tempstring, ila->server);
+ strncpy(tempstring, buff2[2]+1, BUF_LEN);
+ strncat(tempstring, "@", BUF_LEN-strlen(tempstring));
+ strncat(tempstring, ila->server, BUF_LEN-strlen(tempstring));
g_strdown(tempstring);
ecr = find_chat_room_by_id(tempstring);
@@ -748,9 +748,9 @@
buff2 = g_strsplit(buff, " ", 3);
g_strchomp(buff2[2]);
- strcpy(tempstring, buff2[2]);
- strcat(tempstring, "@");
- strcat(tempstring, ila->server);
+ strncpy(tempstring, buff2[2], BUF_LEN);
+ strncat(tempstring, "@", BUF_LEN-strlen(tempstring));
+ strncat(tempstring, ila->server, BUF_LEN-strlen(tempstring));
g_strdown(tempstring);
ecr = find_chat_room_by_id(tempstring);
@@ -775,7 +775,7 @@
buff2 = g_strsplit(buff, " ", 3);
g_strchomp(buff2[2]);
- strcpy(tempstring, buff2[2]+1);
+ strncpy(tempstring, buff2[2]+1, BUF_LEN);
/* Get the nick */
strncpy(nick, buff2[0]+1, 100);
@@ -809,9 +809,9 @@
g_strchomp(buff);
buff2 = g_strsplit(buff, " ", 4);
- strcpy(tempstring, buff2[3]+1);
- strcat(tempstring, "@");
- strcat(tempstring, ila->server);
+ strncpy(tempstring, buff2[3]+1, BUF_LEN);
+ strncat(tempstring, "@", BUF_LEN-strlen(tempstring));
+ strncat(tempstring, ila->server, BUF_LEN-strlen(tempstring));
g_strdown(tempstring);
ecr = find_chat_room_by_id(tempstring);
@@ -873,7 +873,7 @@
{
pointer += 7;
- strcpy(message+ i, nick);
+ strncpy(message+ i, nick, BUF_LEN-i);
i += strlen(nick);
nickcopied = 1;
@@ -892,9 +892,9 @@
buff2 = g_strsplit(message, " ", 3);
g_strchomp(buff2[2]);
- strcpy(tempstring, buff2[2]);
- strcat(tempstring, "@");
- strcat(tempstring, ila->server);
+ strncpy(tempstring, buff2[2], BUF_LEN);
+ strncat(tempstring, "@", BUF_LEN-strlen(tempstring));
+ strncat(tempstring, ila->server,
BUF_LEN-strlen(tempstring));
g_strdown(tempstring);
ecr = find_chat_room_by_id(tempstring);
if(ecr)
@@ -1301,7 +1301,7 @@
temp = value_pair_get_value(pairs, "PASSWORD");
if (temp)
{
- strcpy(ila->password, temp);
+ strncpy(ila->password, temp,
sizeof(ila->password));
}
return (ela);
@@ -1703,21 +1703,21 @@
eb_account * ea = ii->me;
irc_account * ia = (irc_account *)ea->protocol_account_data;
- strcpy(temp, ea->handle);
+ strncpy(temp, ea->handle, BUF_LEN);
alpha = strchr(temp, '@');
if (alpha != NULL) *alpha = '\0';
- sprintf(message, _("<b>User info for</b> %s<br>"), temp);
- sprintf(temp, _("<b>Server:</b> %s<br>"), strlen(ia->realserver)>0 ?
ia->realserver : ia->server);
- strcat(message, temp);
- sprintf(temp, _("<b>Idle time and online status:</b> %s<br>"),
irc_get_status_string(ea));
- strcat(message, temp);
+ snprintf(message, sizeof(message), _("<b>User info for</b> %s<br>"),
temp);
+ snprintf(temp, sizeof(temp), _("<b>Server:</b> %s<br>"),
strlen(ia->realserver)>0 ? ia->realserver : ia->server);
+ strncat(message, temp, sizeof(message)-strlen(message));
+ snprintf(temp, sizeof(temp), _("<b>Idle time and online status:</b>
%s<br>"), irc_get_status_string(ea));
+ strncat(message, temp, sizeof(message)-strlen(message));
if (ii->whois_info != NULL)
{
freeme = strip_color(ii->whois_info);
- sprintf(temp, _("<b>Whois info:</b> %s<br>"), freeme);
+ snprintf(temp, sizeof(temp), _("<b>Whois info:</b> %s<br>"),
freeme);
free(freeme);
- strcat(message, temp);
+ strncat(message, temp, sizeof(message)-strlen(message));
}
eb_info_window_clear(iw);
@@ -1831,7 +1831,7 @@
ret = sendall(ila->fd, buff, strlen(buff));
if (ret == -1) irc_logout(room->local_user);
- strcpy(nick, room->local_user->alias);
+ strncpy(nick, room->local_user->alias, 255);
alpha = strchr(nick, '@');
if (alpha != NULL) *alpha = '\0';
@@ -1881,7 +1881,7 @@
strcpy(channelname, "#");
}
- strcat(channelname, name);
+ strncat(channelname, name, strlen(name)+100);
if (strrchr(channelname, '@') != NULL)
{
@@ -1901,8 +1901,8 @@
irc_local_account * ila = (irc_local_account
*)ela->protocol_local_account_data;
chatroom_server = strdup(ila->server);
- strcat(channelname, "@");
- strcat(channelname, chatroom_server);
+ strncat(channelname, "@",
strlen(name)+100-strlen(channelname));
+ strncat(channelname, chatroom_server,
strlen(name)+100-strlen(channelname));
break;
}
}
@@ -1919,12 +1919,12 @@
ecr = g_new0(eb_chat_room, 1);
- strcpy(ecr->id, channelname);
+ strncpy(ecr->id, channelname, sizeof(ecr->id));
alpha = strchr(channelname, '@');
if (alpha != NULL) *alpha = '\0';
- strcpy(ecr->room_name, channelname);
+ strncpy(ecr->room_name, channelname, sizeof(ecr->room_name));
ecr->connected = 0;
ecr->local_user = irc_search_for_local_account (chatroom_server);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/modules/irc irc.c,1.16,1.17,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.431,1.432 configure.in,1.428,1.429
- Next by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.432,1.433 configure.in,1.429,1.430
- Previous by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.431,1.432 configure.in,1.428,1.429
- Next by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.432,1.433 configure.in,1.429,1.430
- Index(es):