1995-09-25 - Re: Defense against a class of programming bugs

Header Data

From: patrick@Verity.COM (Patrick Horgan)
To: rsalz@osf.org
Message Hash: b5038506306d104974eff5944ac4e42e4c4fc29b08f7aa9bbe355ea44d00ba13
Message ID: <9509251742.AA21506@cantina.verity.com>
Reply To: N/A
UTC Datetime: 1995-09-25 17:46:32 UTC
Raw Date: Mon, 25 Sep 95 10:46:32 PDT

Raw message

From: patrick@Verity.COM (Patrick Horgan)
Date: Mon, 25 Sep 95 10:46:32 PDT
To: rsalz@osf.org
Subject: Re: Defense against a class of programming bugs
Message-ID: <9509251742.AA21506@cantina.verity.com>
MIME-Version: 1.0
Content-Type: text/plain


> 
> >Unfortunately, strdup is not posix compliant.  If you want to use
> >it and maintain portability, you'll have to write your own.
> 
> Er, you're kidding, right?  drand48 isn't in Posix either, for example.
> Someone who runs on Motif and Mac has strdup as the least of their
> worries.  But just in case it's stopping anyone:
> 	char *strdup(const char *x) { char *p;
> 	    return (p = malloc(strlen(x) + 1)) ? strcpy(p, x) : 0;
> 	}

Nah, I'm not kidding...I have to write code that runs on LOTS of platforms
including macs, pcs, and lots of variants of Unix...I assume there's a
lot of others that do as well...you have to make money where you can, and
even with free software given out to the net, you want to make it portable
as a matter of pride.

Patrick
   _______________________________________________________________________
  /  These opinions are mine, and not Verity's (except by coincidence;).  \
 |                                                       (\                |
 |  Patrick J. Horgan         Verity Inc.                 \\    Have       |
 |  patrick@verity.com        1550 Plymouth Street         \\  _ Sword     | 
 |  Phone : (415)960-7600     Mountain View                 \\/    Will    | 
 |  FAX   : (415)960-7750     California 94303             _/\\     Travel | 
  \___________________________________________________________\)__________/





Thread