Compiler warning fix
authorYang Tse <yangsita@gmail.com>
Sun, 28 Jan 2007 03:51:10 +0000 (03:51 +0000)
committerYang Tse <yangsita@gmail.com>
Sun, 28 Jan 2007 03:51:10 +0000 (03:51 +0000)
tests/libtest/lib518.c
tests/libtest/lib537.c

index 3f5ac11..ffe3896 100644 (file)
@@ -251,7 +251,7 @@ static int rlimit(int keep_open)
 
   /* 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);
index fd030dd..ab24b42 100644 (file)
@@ -233,7 +233,7 @@ static int rlimit(int keep_open)
 
   /* 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);