🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Francois Pinard Tue, 26 Jan 1993 01:12
lib/error.c and lib/xmalloc.c improvements
#1312
Author: Francois Pinard
Date: Tue, 26 Jan 1993 01:12
58 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads