if (!list)
return
if( !list )
{
if( fShowNothing )
{
send_to_char( " Nothing.\r\n", ch );
}
return;
}
for(d = descriptor_list; d; d = d_next)
{
d_next = d->next;
…. (continue normal code here)
void write_to_buffer( DESCRIPTOR_DATA *d, const char *txt, int length )
{
/*
* Find length in case caller didn't.
*/
if ( length <= 0 )
length = strlen(txt);
/*
* Initial \n\r if needed.
*/
if ( d->outtop == 0 && !d->fcommand )
{
d->outbuf[0] = '\n';
d->outbuf[1] = '\r';
d->outtop = 2;
}
/*
* Expand the buffer as needed.
*/
while ( d->outtop + length >= d->outsize )
{
char *outbuf;
if (d->outsize >= 32000)
{
bug("Buffer overflow. Closing.\n\r",0);
close_socket(d);
return;
}
//outbuf = alloc_mem( 2 * d->outsize );
CREATE(outbuf,char,(2 * d->outsize));
strncpy( outbuf, d->outbuf, d->outtop );
//free_mem( d->outbuf, d->outsize );
DISPOSE(d->outbuf);
d->outbuf = outbuf;
d->outsize *= 2;
}
/*
* Copy.
*/
strncpy( d->outbuf + d->outtop, txt, length );
d->outtop += length;
return;
}
3103 rgFreeList[iList] = * ((void **) rgFreeList[iList]);
(gdb) print iList
$1 = 0
(gdb) print rgFreeList
$2 = {0x6e797b73, 0x0, 0x4041512c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x40415964, 0x0}
(gdb) print rgFreeList[iList]
$3 = (void *) 0x6e797b73
db.c the function.
I dont know whats wrong :/