[BACK]Return to xmalloc.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rcs

Diff for /src/usr.bin/rcs/xmalloc.c between version 1.3 and 1.4

version 1.3, 2007/02/27 07:59:13 version 1.4, 2009/06/07 08:39:13
Line 44 
Line 44 
   
         if (size == 0 || nmemb == 0)          if (size == 0 || nmemb == 0)
                 errx(1, "xcalloc: zero size");                  errx(1, "xcalloc: zero size");
         if (SIZE_T_MAX / nmemb < size)          if (SIZE_MAX / nmemb < size)
                 errx(1, "xcalloc: nmemb * size > SIZE_T_MAX");                  errx(1, "xcalloc: nmemb * size > SIZE_MAX");
         ptr = calloc(nmemb, size);          ptr = calloc(nmemb, size);
         if (ptr == NULL)          if (ptr == NULL)
                 errx(1, "xcalloc: out of memory (allocating %lu bytes)",                  errx(1, "xcalloc: out of memory (allocating %lu bytes)",
Line 61 
Line 61 
   
         if (new_size == 0)          if (new_size == 0)
                 errx(1, "xrealloc: zero size");                  errx(1, "xrealloc: zero size");
         if (SIZE_T_MAX / nmemb < size)          if (SIZE_MAX / nmemb < size)
                 errx(1, "xrealloc: nmemb * size > SIZE_T_MAX");                  errx(1, "xrealloc: nmemb * size > SIZE_MAX");
         if (ptr == NULL)          if (ptr == NULL)
                 new_ptr = malloc(new_size);                  new_ptr = malloc(new_size);
         else          else

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4