rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: culliton@srg.af.mil (Tom Culliton x2278)
To: rc@hawkwind.utcs.toronto.edu
Subject: A potentially useful patch
Date: Mon, 20 Sep 1993 20:33:48 -0400	[thread overview]
Message-ID: <9309202033.aa10448@ceres.srg.af.mil> (raw)

Sigh.... While trying to get Alan's read integrated I rediscovered that
SCO-ODT 1.1 has a broken realloc.  It dumps core when it gets a null
pointer for the old buffer.  Fortunately Byron's code doesn't seem to
rely on this behaviour.  Just in case though, here's a patch for other
folks in the same boat.

Tom

*** config.h.old	Wed Feb  3 15:37:36 1993
--- config.h	Mon Sep 20 20:29:01 1993
***************
*** 108,113 ****
--- 108,122 ----
  #define NOJOB
   */
  
+ /*
+  * SCO-ODT 1.1 has a broken realloc which dumps core when it gets a null
+  * pointer for the old buffer.  Byron's code doesn't seem to rely on this
+  * behaviour, but just in case something in the future does, you can define
+  * this to enable a fanny shield.  Don't do it unless you know that you
+  * have this problem.
+ #define BROKENREALLOC
+ */
+  
  /* Beginning of defaults section: */
  
  #ifndef CUSTOM
*** nalloc.c.old	Thu Feb 27 02:22:10 1992
--- nalloc.c	Mon Sep 20 19:43:52 1993
***************
*** 122,127 ****
--- 122,132 ----
  
  extern void *erealloc(void *p, SIZE_T n) {
  	extern void *realloc(void *, SIZE_T);
+ #ifdef BROKENREALLOC
+ 	if (!p) {
+ 		p = ealloc(n);
+ 	} else
+ #endif
  	if ((p = realloc(p, n)) == NULL) {
  		uerror("realloc");
  		rc_exit(1);


             reply	other threads:[~1993-09-21  1:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-21  0:33 Tom Culliton x2278 [this message]
1993-09-21 14:17 rsalz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9309202033.aa10448@ceres.srg.af.mil \
    --to=culliton@srg.af.mil \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).