+2003-03-03 James Antill <james@and.org>
+
+ * src/tetrinet.c (tetrinet_sendfield): Put a warning in if blocks are
+ out of range.
+
2003-02-24 Dani Carbonell <bocata@panete.net>
* src/partyline.c (stop_list): list_issued is a integer, changed
void tetrinet_sendfield (int reset)
{
- int x, y, i, d = FALSE; /* d is the number of differences */
+ int x, y, i, d = 0; /* d is the number of differences */
char buf[1024], *p;
char diff_buf[15][(FIELDWIDTH + 1)* FIELDHEIGHT * 2] = {0};
const int block = fields[playernum][y][x];
+ if ((block < 0) || (block >= 15))
+ {
+ g_warning("sendfield shouldn't reach here, block=%d\n", block);
+ continue;
+ }
+
if (block != sentfield[y][x]) {
diff_buf[block][row_count[block]++] = x + '3';
diff_buf[block][row_count[block]++] = y + '3';