[BACK]Return to xmalloc.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / libexec / ld.elf_so

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/libexec/ld.elf_so/xmalloc.c between version 1.1 and 1.2

version 1.1, 1996/12/16 20:38:07 version 1.2, 1999/03/01 16:40:08
Line 1 
Line 1 
 /*      $NetBSD$        */  /*      $NetBSD$         */
   
 /*  /*
  * Copyright 1996 John D. Polstra.   * Copyright 1996 John D. Polstra.
Line 31 
Line 31 
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */   */
   
   #include <sys/cdefs.h>
 #include "rtldenv.h"  #include "rtldenv.h"
 #include <stddef.h>  #include <stddef.h>
   #include <errno.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
 void *  void *
 xcalloc(size_t size)  xcalloc(size)
           size_t size;
 {  {
     return memset(xmalloc(size), 0, size);          return memset(xmalloc(size), 0, size);
 }  }
   
 void *  void *
 xmalloc(size_t size)  xmalloc(size)
           size_t size;
 {  {
     void *p = malloc(size);          void *p = malloc(size);
     if(p == NULL)          if (p == NULL)
         xerr(1, "Out of memory");                  xerr(1, "%s", xstrerror(errno));
     return p;          return p;
 }  }
   
 char *  char*
 xstrdup(const char *s)  xstrdup(s)
           const char *s;
 {  {
     char *p = strdup(s);          char *p = strdup(s);
     if(p == NULL)          if (p == NULL)
         xerr(1, "Out of memory");                  xerr(1, "%s", xstrerror(errno));
     return p;          return p;
 }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

CVSweb <webmaster@jp.NetBSD.org>