No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / diffutils / lib / malloc.c
bloba457e44736a25f956d612d1c50b7777b772f5159
1 /* $NetBSD$ */
3 /* Work around bug on some systems where malloc (0) fails.
4 Copyright (C) 1997, 1998 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software Foundation,
18 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20 /* written by Jim Meyering */
22 #if HAVE_CONFIG_H
23 # include <config.h>
24 #endif
25 #undef malloc
27 #include <sys/types.h>
29 char *malloc ();
31 /* Allocate an N-byte block of memory from the heap.
32 If N is zero, allocate a 1-byte block. */
34 char *
35 rpl_malloc (size_t n)
37 if (n == 0)
38 n = 1;
39 return malloc (n);