Ok, im using the easy color stuff, with
&r type of color codes.
The problem arise when im trying to send lots of
colors to the player.
It is about 10*10 chars, each with the
color &b&v &n. (or less)
This makes the game crash,
but ONLY for players with a slow connection.
The crash occurs when the player spams the command.
Heres the proc_color function:
/****************************************/
void proc_color(char *inbuf, int colour)
{
register int j = 0, p = 0;
int k, max, c = 0;
char out_buf[98298];
if (inbuf[0] == '\0')
return;
while (inbuf[j] != '\0') {
if ((inbuf[j]=='\\') && (inbuf[j+1]=='c')
&& isnum(inbuf[j + 2]) && isnum(inbuf[j + 3])) {
c = (inbuf[j + 2] - '0')*10 + inbuf[j + 3]-'0';
j += 4;
}
else if ((inbuf[j] == '&') && !(is_colour(inbuf[j +
1]) == -1)) {
c = is_colour(inbuf[j + 1]);
j += 2;
}
else {
out_buf[p] = inbuf[j];
j++;
p++;
continue;
}
if (c > MAX_COLORS)
c = 0;
max = strlen(COLOURLIST[c]);
if (colour || max == 1)
for (k = 0; k < max; k++) {
out_buf[p] = COLOURLIST[c][k];
p++;
}
}
out_buf[p] = '\0';
strcpy(inbuf, out_buf);
}
and here is the gdb output:
/*****************************************/
#0 strcpy (
dest=0xbfffc5cc "\r\n\n\r \e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m"...,
src=0xbffe45b0 "\r\n\n\r \e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m"...) at
../sysdeps/generic/strcpy.c:38
#1 0x809025d in proc_color (
inbuf=0xbfffc5cc "\r\n\n\r \e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m
\e[0;0m\e[0;34m\e[7m \e[0;0m\e[0;34m\e[7m"..., colour=1)
at color.c:167
#2 0x808c80f in process_output (t=0x375b1b6d) at
comm.c:1377
#3 0x34333b30 in ?? ()
Cannot access memory at address 0x5b1b2020
(gdb)
/****************************************************/
Any info would be appreciated.
/**********************************/
/* Emil Nilimaa */
/* zeudes */
/* www.sharune.com */
/**********************************/
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 04/10/01 PDT