/* 
 * utils.c
 *
 * x-kernel v3.3
 *
 * Copyright (c) 1993,1991,1990,1996  Arizona Board of Regents
 *
 * $Log: utils.c,v $
 * Revision 1.2  1996/01/30 20:52:53  slm
 * Updated copyright and version.
 *
 * Revision 1.1  1995/07/29  02:42:45  slm
 * Initial revision
 *
 * Revision 1.1.1.2  1994/11/22  22:06:09  hkaram
 * Added xRealloc
 *
 * Revision 1.1.1.1  1994/11/12  19:13:49  hkaram
 * New branch
 *
 * Revision 1.1  1993/11/13  00:45:54  menze
 * Original version from UMass
 *
 * 1.1.1.1
 * 1993/06/09 00:48:16
 */

#include "x_stdio.h"
#include "x_libc.h"
#include "x_util.h"

/*
 * extern char *	malloc();
 * extern int	abort();
 */


char *
xMalloc( unsigned s )
{
    char *p;

    if ( (p = malloc(s)) != (char *) 0 ) {
	return p;
    }
    Kabort("malloc failed");
    return 0;
}


char *
xRealloc( char *p, unsigned int newsize )
{
  char *q;

  q = (char *)realloc(p, newsize);
  if ( newsize && q == NULL )
    Kabort("malloc failed");
  return q;
}
