about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2017-09-03 15:34:21 -0400
committerJune McEnroe <june@causal.agency>2017-09-03 15:34:21 -0400
commit0c5568b6a60d67bbbf84fd037d41826ccc497b8e (patch)
tree184ca157934920db02f43f4a1fa4b1bc2e2f1f74
parentRelicense AGPL (diff)
downloadtorus-0c5568b6a60d67bbbf84fd037d41826ccc497b8e.tar.gz
torus-0c5568b6a60d67bbbf84fd037d41826ccc497b8e.zip
Assert client coords are valid after movement
-rw-r--r--server.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/server.c b/server.c
index 09bd36b..c3b594b 100644
--- a/server.c
+++ b/server.c
@@ -249,6 +249,11 @@ static bool clientMove(struct Client *client, int8_t dx, int8_t dy) {
     if (client->tileY == TILE_ROWS)  client->tileY = 0;
     if (client->tileY == UINT32_MAX) client->tileY = TILE_ROWS - 1;
 
+    assert(client->cellX < CELL_COLS);
+    assert(client->cellY < CELL_ROWS);
+    assert(client->tileX < TILE_COLS);
+    assert(client->tileY < TILE_ROWS);
+
     return clientUpdate(client, &old);
 }
 
7 -0500'>2021-02-07Use scrot for up -s if no screencaptureJune McEnroe 2021-02-07Enable mouse acceleration in XJune McEnroe 2021-02-07Set colours for Xt and cwmJune McEnroe 2021-02-07Set urgency on bell in xtermJune McEnroe 2021-02-07Add bindings for brightness controlJune McEnroe 2021-02-07Set X key repeat rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 2021-02-07Fully configure and rebind cwmJune McEnroe 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe 2021-02-06Add xterm output to schemeJune McEnroe