diff options
Diffstat (limited to 'libX11/include/X11/Xregion.h')
-rw-r--r-- | libX11/include/X11/Xregion.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libX11/include/X11/Xregion.h b/libX11/include/X11/Xregion.h index c25d70b41..cf10f86df 100644 --- a/libX11/include/X11/Xregion.h +++ b/libX11/include/X11/Xregion.h @@ -112,10 +112,11 @@ typedef struct _XRegion { */ #define MEMCHECK(reg, rect, firstrect){\ if ((reg)->numRects >= ((reg)->size - 1)){\ - (firstrect) = (BOX *) Xrealloc \ - ((char *)(firstrect), (unsigned) (2 * (sizeof(BOX)) * ((reg)->size)));\ - if ((firstrect) == 0)\ + BoxPtr tmpRect = Xrealloc ((firstrect), \ + (2 * (sizeof(BOX)) * ((reg)->size))); \ + if (tmpRect == NULL) \ return(0);\ + (firstrect) = tmpRect; \ (reg)->size *= 2;\ (rect) = &(firstrect)[(reg)->numRects];\ }\ |