diff options
Diffstat (limited to 'src/vmwaremodes.c')
-rw-r--r-- | src/vmwaremodes.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vmwaremodes.c b/src/vmwaremodes.c index 2965dca..41a9b4f 100644 --- a/src/vmwaremodes.c +++ b/src/vmwaremodes.c @@ -102,7 +102,9 @@ vmwareAddDefaultMode(ScrnInfoPtr pScrn, uint32 dwidth, uint32 dheight) dispModeList = pScrn->display->modes; while(*dispModeList) dispModeList++; - dispModeCount = dispModeList - pScrn->display->modes; + dispModeCount = (unsigned)(((size_t)dispModeList - + (size_t)pScrn->display->modes) / + sizeof(*dispModeList)); } dispModeList = xnfcalloc(dispModeCount + 2, sizeof(*dispModeList)); |