PTRDIFF_MAX.
* lib/xalloc-oversized.h: Adjust comment to match.
+ xmalloca, etc.: fix some xalloc-oversized issues
+ * lib/malloca.h (nmalloca):
* lib/xmalloca.h (xnmalloca): Convert S to ptrdiff_t to avoid
arithmetic overflow if N and S are both narrower than ptrdiff_t.
* lib/xalloc-oversized.h (xalloc_oversized):
on the stack. S must be positive and N must be nonnegative.
The array must be freed using freea() before the function returns. */
#define nmalloca(n, s) \
- (xalloc_oversized (n, s) ? NULL : malloca ((n) * (ptrdiff_t) (s)))
+ (xalloc_oversized (n, s) ? NULL : malloca ((n) * (size_t) (s)))
#ifdef __cplusplus