Article View: gnu.utils.bug
Article #1312lib/error.c and lib/xmalloc.c improvements
From: Francois Pinard
Date: Tue, 26 Jan 1993 01:12
Date: Tue, 26 Jan 1993 01:12
58 lines
2248 bytes
2248 bytes
Hi, people.
Comparing GNU text utilities 1.4's lib directory with the routines I
sometimes distribute, I realize that lib/error.c and lib/xmalloc.c are
lacking the conditionnal inclusion of "config.h". Could this be added
to the common version?
Also, various malloc's do not behave regularily when given 0 as
argument. xmalloc will abort if malloc returns NULL. What about
xmalloc returning NULL without calling malloc, whenever given 0 as
argument?
Reversed diffs follow:
---------------------------------------------------------------------->
/usr0/tmp/textutils-1.4/lib) diff -u ~/3/libgnu .
diff -u /usr2/pinard/3/libgnu/error.c ./error.c
--- /usr2/pinard/3/libgnu/error.c Fri Jan 1 17:22:39 1993
+++ ./error.c Sat Jul 18 14:23:10 1992
@@ -17,10 +17,6 @@
/* Written by David MacKenzie. */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <stdio.h>
#ifdef HAVE_VPRINTF
--- /usr2/pinard/3/libgnu/xmalloc.c Fri Jan 1 17:25:54 1993
+++ ./xmalloc.c Sat Jul 18 14:27:23 1992
@@ -15,10 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#ifdef STDC_HEADERS
#include <stdlib.h>
#else
@@ -37,8 +33,6 @@
{
char *p;
- if (n == 0)
- return 0;
p = malloc (n);
if (p == 0)
/* Must exit with 2 for `cmp'. */
----------------------------------------------------------------------<
--
Franc,ois Pinard ``Vivement GNU!'' pinard@iro.umontreal.ca
(514) 588-4656 ...!uunet!iros1!pinard
About the League for Programming Freedom? Email me or lpf@uunet.uu.net
Technical Details
Message-ID:
<9301230331.AA04084@icule.UUCP>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!icule.UUCP!pinardShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!icule.UUCP!pinard From: pinard@icule.UUCP (Francois Pinard) Newsgroups: gnu.utils.bug Subject: lib/error.c and lib/xmalloc.c improvements Date: 25 Jan 1993 20:12:48 -0500 Organization: GNUs Not Usenet Lines: 59 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-utils@prep.ai.mit.edu Distribution: gnu Message-ID: <9301230331.AA04084@icule.UUCP> Reply-To: pinard@iro.umontreal.ca