aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/CCC.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-10 23:57:55 -0700
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:28 +0200
commitd33cf0446fa6bd838f0020da2fd4a0884c2bc5ef (patch)
tree705b14146584bc166d2a05a2e9838d9a6c34a505 /nx-X11/lib/X11/CCC.c
parentc161df4fee61819a28089682963cc2e721ca22c8 (diff)
downloadnx-libs-d33cf0446fa6bd838f0020da2fd4a0884c2bc5ef.tar.gz
nx-libs-d33cf0446fa6bd838f0020da2fd4a0884c2bc5ef.tar.bz2
nx-libs-d33cf0446fa6bd838f0020da2fd4a0884c2bc5ef.zip
Don't cast sizeof() results to unsigned when passing to Xmalloc/Xcalloc
sizeof() returns size_t, malloc() & calloc() expect sizes in size_t, don't strip down to unsigned int and re-expand unnecessarily. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib/X11/CCC.c')
-rw-r--r--nx-X11/lib/X11/CCC.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/nx-X11/lib/X11/CCC.c b/nx-X11/lib/X11/CCC.c
index da8b661dc..de6d6318a 100644
--- a/nx-X11/lib/X11/CCC.c
+++ b/nx-X11/lib/X11/CCC.c
@@ -111,7 +111,7 @@ XcmsCreateCCC(
XcmsPerScrnInfo *pNewScrnInfo;
if (pDefaultCCC == NULL ||
- !(newccc = Xcalloc(1, (unsigned) sizeof(XcmsCCCRec)))) {
+ !(newccc = Xcalloc(1, sizeof(XcmsCCCRec)))) {
return(NULL);
}
@@ -144,8 +144,7 @@ XcmsCreateCCC(
* If one exists replace the pPerScrnInfo.
*/
if ((pIMap = _XcmsGetIntensityMap(dpy, visual)) != NULL) {
- if (!(pNewScrnInfo =
- Xcalloc(1, (unsigned) sizeof(XcmsPerScrnInfo)))) {
+ if (!(pNewScrnInfo = Xcalloc(1, sizeof(XcmsPerScrnInfo)))) {
Xfree(newccc);
return(NULL);
}