diff options
Diffstat (limited to 'libX11/include/X11')
-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 54afcd0bb..70caa1a03 100644 --- a/libX11/include/X11/Xregion.h +++ b/libX11/include/X11/Xregion.h @@ -114,10 +114,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];\ }\ |