IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4505


Ignore:
Timestamp:
Jul 7, 2005, 12:03:16 PM (21 years ago)
Author:
jhoblitt
Message:

add xrealloc()

Location:
trunk/Nebulous/nebclient/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/nebclient/src/xmalloc.c

    r3017 r4505  
    44 * Copyright (C) 2003  Robert Lupton
    55 *
    6  * $Id: xmalloc.c,v 1.1 2005-01-16 10:37:59 jhoblitt Exp $
     6 * $Id: xmalloc.c,v 1.2 2005-07-07 22:03:16 jhoblitt Exp $
    77 */
    88
     
    2727   return(ptr);
    2828}
     29
     30void *
     31xrealloc(void *ptr, size_t size)
     32{
     33    void *newptr = realloc(ptr, size);
     34
     35    if (!newptr) {
     36        perror("realloc");
     37        exit(EXIT_FAILURE);
     38    }
     39
     40    return(newptr);
     41}
    2942 
    3043void
  • trunk/Nebulous/nebclient/src/xmalloc.h

    r3022 r4505  
    44 * Copyright (C) 2003  Robert Lupton
    55 *
    6  * $Id: xmalloc.h,v 1.2 2005-01-16 19:49:09 jhoblitt Exp $
     6 * $Id: xmalloc.h,v 1.3 2005-07-07 22:03:16 jhoblitt Exp $
    77 */
    88
     
    1212void *
    1313xmalloc(size_t n);
     14
     15void *
     16xrealloc(void *ptr, size_t size);
    1417 
    1518void
Note: See TracChangeset for help on using the changeset viewer.