summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@fido2.homeip.net>2006-10-30 10:53:18 -0800
committerPhilip Langdale <philipl@fido2.homeip.net>2006-10-30 10:53:18 -0800
commite0dca2ff0b695b60830cf8f10a2c0585602a4d40 (patch)
tree2f1b18442afb44b94e0d1a9b69829281b01038e3
parentf96d12047725becf0515cc4df8572ca4a3956309 (diff)
Fix some warnings noted when compiling the code against
older Xorg versions.
-rw-r--r--src/vmware.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vmware.c b/src/vmware.c
index 244548c..e778625 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -166,7 +166,7 @@ typedef enum {
OPTION_HW_CURSOR,
OPTION_NOACCEL,
OPTION_XINERAMA,
- OPTION_STATIC_XINERAMA,
+ OPTION_STATIC_XINERAMA
} VMWAREOpts;
static const OptionInfoRec VMWAREOptions[] = {
@@ -448,6 +448,12 @@ VMWAREParseTopologyElement(ScrnInfoPtr pScrn,
strncpy(buf, str, i);
*outValue = atoi(buf);
+ if (*outValue > (unsigned short)-1) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Output %u: %s must be less than %hu.\n",
+ output, elementName, (unsigned short)-1);
+ goto exit;
+ }
+
str += i;
if (needTerminator || str[0] != '\0') {
@@ -477,8 +483,8 @@ VMWAREParseTopologyElement(ScrnInfoPtr pScrn,
static xXineramaScreenInfo *
VMWAREParseTopologyString(ScrnInfoPtr pScrn,
- const char *topology, // IN:
- unsigned int *retNumOutputs) // OUT:
+ const char *topology,
+ unsigned int *retNumOutputs)
{
xXineramaScreenInfo *extents = NULL;
unsigned int numOutputs = 0;
@@ -515,7 +521,7 @@ VMWAREParseTopologyString(ScrnInfoPtr pScrn,
}
str += i;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Output %u: %hux%hu+%hu+%hu\n",
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Output %u: %ux%u+%u+%u\n",
numOutputs, width, height, x, y);
numOutputs++;