/* verify that we won't overflow size_t in malloc() */
- if (num_open.rlim_max > ((size_t)-1) / sizeof(*fd)) {
+ if ((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) {
sprintf(strbuff1, fmt, num_open.rlim_max);
sprintf(strbuff, "unable to allocate an array for %s "
"file descriptors, would overflow size_t", strbuff1);
/* verify that we won't overflow size_t in malloc() */
- if (num_open.rlim_max > ((size_t)-1) / sizeof(*fd)) {
+ if ((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) {
sprintf(strbuff1, fmt, num_open.rlim_max);
sprintf(strbuff, "unable to allocate an array for %s "
"file descriptors, would overflow size_t", strbuff1);