summaryrefslogtreecommitdiff
path: root/src/XrrProperty.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/XrrProperty.c')
-rw-r--r--src/XrrProperty.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/XrrProperty.c b/src/XrrProperty.c
index 502e834..0a4471a 100644
--- a/src/XrrProperty.c
+++ b/src/XrrProperty.c
@@ -39,7 +39,6 @@ XRRListOutputProperties (Display *dpy, RROutput output, int *nprop)
XExtDisplayInfo *info = XRRFindDisplay(dpy);
xRRListOutputPropertiesReply rep;
xRRListOutputPropertiesReq *req;
- int nbytes, rbytes;
Atom *props = NULL;
RRCheckExtension (dpy, info, NULL);
@@ -58,8 +57,8 @@ XRRListOutputProperties (Display *dpy, RROutput output, int *nprop)
}
if (rep.nAtoms) {
- rbytes = rep.nAtoms * sizeof (Atom);
- nbytes = rep.nAtoms << 2;
+ size_t rbytes = rep.nAtoms * sizeof (Atom);
+ size_t nbytes = rep.nAtoms << 2;
props = (Atom *) Xmalloc (rbytes);
if (props == NULL) {
@@ -85,7 +84,7 @@ XRRQueryOutputProperty (Display *dpy, RROutput output, Atom property)
XExtDisplayInfo *info = XRRFindDisplay(dpy);
xRRQueryOutputPropertyReply rep;
xRRQueryOutputPropertyReq *req;
- unsigned int rbytes, nbytes;
+ unsigned int nbytes;
XRRPropertyInfo *prop_info;
RRCheckExtension (dpy, info, NULL);
@@ -104,7 +103,7 @@ XRRQueryOutputProperty (Display *dpy, RROutput output, Atom property)
}
if (rep.length < ((INT_MAX / sizeof(long)) - sizeof (XRRPropertyInfo))) {
- rbytes = sizeof (XRRPropertyInfo) + (rep.length * sizeof (long));
+ size_t rbytes = sizeof (XRRPropertyInfo) + (rep.length * sizeof (long));
nbytes = rep.length << 2;
prop_info = Xmalloc (rbytes);
@@ -257,7 +256,6 @@ XRRGetOutputProperty (Display *dpy, RROutput output,
XExtDisplayInfo *info = XRRFindDisplay(dpy);
xRRGetOutputPropertyReply rep;
xRRGetOutputPropertyReq *req;
- unsigned long nbytes, rbytes;
/* Always initialize return values, in case callers fail to initialize
them and fail to check the return code for an error. */
@@ -289,6 +287,7 @@ XRRGetOutputProperty (Display *dpy, RROutput output,
if (rep.propertyType != None) {
int format = rep.format;
+ size_t nbytes, rbytes;
/*
* Protect against both integer overflow and just plain oversized