Here's my fix:
for (i = 0; i < GRID_SIZE - 1; ++i) { // Note the "-1"...
// Top Edge
grid[0][i] = 0;
// Bottom Edge
grid[GRID_SIZE - 1][GRID_SIZE - i - 1] = 0; // Reverse the order: from left to right
// Left Edge
grid[GRID_SIZE - i - 1][0] = 0; // Reverse the order: from bottom to top
// Right Edge
grid[i][GRID_SIZE - 1] = 0;
}
This way, for every row/column, the loop acts on all but the last cell, which is actually the first cell of some other column/row.