summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/guic-x11.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-09 20:03:31 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-09 20:03:31 +0000
commita8980abc1797bd8bf4056a8532614e6bc336444a (patch)
treee30c44907da4f472bedad4984ec7cca2afcd5274 /crawl-ref/source/guic-x11.cc
parent9b54374b1ff999f0302cc856106468c49de561d0 (diff)
downloadcrawl-ref-a8980abc1797bd8bf4056a8532614e6bc336444a.tar.gz
crawl-ref-a8980abc1797bd8bf4056a8532614e6bc336444a.zip
Small fix for previous check-in to prevent writes outside mini-map array bounds.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3421 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/guic-x11.cc')
-rw-r--r--crawl-ref/source/guic-x11.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/crawl-ref/source/guic-x11.cc b/crawl-ref/source/guic-x11.cc
index 275ca17f23..143bd73946 100644
--- a/crawl-ref/source/guic-x11.cc
+++ b/crawl-ref/source/guic-x11.cc
@@ -329,13 +329,12 @@ void MapRegionClass::draw_data(unsigned char *buf)
XPutPixel(backbuf, xx, py*dy+dy/2 + y_margin, map_pix[MAP_BLACK]);
}
- for (int y = 0; y < my; y++)
+ for (int y = 0; y < my - y_margin; y++)
{
unsigned char *ptr = &buf[y * (mx2 - x_margin)];
- for (int x = 0; x < mx; x++)
+ for (int x = 0; x < mx - x_margin; x++)
{
- int col = (y >= my2 - y_margin || x >= mx2 - x_margin) ?
- MAP_BLACK : ptr[x];
+ int col = ptr[x];
if (col == Options.tile_player_col)
{
px = x;