diff -r -N -c socketmud/src/mud.h socketmud_new/src/mud.h *** socketmud/src/mud.h 2004-01-07 18:31:51.000000000 +0100 --- socketmud_new/src/mud.h 2004-12-12 14:05:53.000000000 +0100 *************** *** 34,48 **** #define COPYOVER_FILE "../txt/copyover.dat" /* tempfile to store copyover data */ #define EXE_FILE "../src/SocketMud" /* the name of the mud binary */ ! /* Connection States */ #define STATE_NEW_NAME 0 #define STATE_NEW_PASSWORD 1 #define STATE_VERIFY_PASSWORD 2 #define STATE_ASK_PASSWORD 3 #define STATE_PLAYING 4 ! #define STATE_CLOSED 5 /* should always be the last state */ ! /* Thread States */ #define TSTATE_LOOKUP 0 /* Socket is in host_lookup */ #define TSTATE_DONE 1 /* The lookup is done. */ #define TSTATE_WAIT 2 /* Closed while in thread. */ --- 34,48 ---- #define COPYOVER_FILE "../txt/copyover.dat" /* tempfile to store copyover data */ #define EXE_FILE "../src/SocketMud" /* the name of the mud binary */ ! /* Connection states */ #define STATE_NEW_NAME 0 #define STATE_NEW_PASSWORD 1 #define STATE_VERIFY_PASSWORD 2 #define STATE_ASK_PASSWORD 3 #define STATE_PLAYING 4 ! #define STATE_CLOSED 5 ! /* Thread states - please do not change the order of these states */ #define TSTATE_LOOKUP 0 /* Socket is in host_lookup */ #define TSTATE_DONE 1 /* The lookup is done. */ #define TSTATE_WAIT 2 /* Closed while in thread. */ diff -r -N -c socketmud/src/socket.c socketmud_new/src/socket.c *** socketmud/src/socket.c 2004-07-14 18:49:04.000000000 +0200 --- socketmud_new/src/socket.c 2004-12-12 14:06:38.000000000 +0100 *************** *** 518,524 **** { static char output[8 * MAX_BUFFER]; bool underline = FALSE, bold = FALSE; ! int iPtr = 0, last = -1, i = 0, j, k; int length = strlen(txt); /* the color struct */ --- 518,524 ---- { static char output[8 * MAX_BUFFER]; bool underline = FALSE, bold = FALSE; ! int iPtr = 0, last = -1, j, k; int length = strlen(txt); /* the color struct */ *************** *** 567,573 **** dsock->top_output = 2; } ! while (*txt != '\0' && i++ < length) { /* simple bound checking */ if (iPtr > (8 * MAX_BUFFER - 15)) --- 567,573 ---- dsock->top_output = 2; } ! while (*txt != '\0') { /* simple bound checking */ if (iPtr > (8 * MAX_BUFFER - 15)) *************** *** 579,585 **** output[iPtr++] = *txt++; break; case '#': ! i++; txt++; /* toggle underline on/off with #u */ if (*txt == 'u') --- 579,585 ---- output[iPtr++] = *txt++; break; case '#': ! txt++; /* toggle underline on/off with #u */ if (*txt == 'u') diff -r -N -c socketmud/src/strings.c socketmud_new/src/strings.c *** socketmud/src/strings.c 2002-03-09 19:50:04.000000000 +0100 --- socketmud_new/src/strings.c 2004-12-12 14:07:13.000000000 +0100 *************** *** 170,176 **** /* Clear a buffer's contents, but do not deallocate anything */ void buffer_clear(BUFFER *buffer) { ! buffer->len = 0; } /* print stuff, append to buffer. safe. */ --- 170,177 ---- /* Clear a buffer's contents, but do not deallocate anything */ void buffer_clear(BUFFER *buffer) { ! buffer->len = 0; ! buffer->data[0] = '\0'; } /* print stuff, append to buffer. safe. */