Path: utzoo!attcan!uunet!husc6!uwvax!oddjob!ncar!ames!umd5!brl-adm!brl-smoke!gwyn
From: gwyn@brl-smoke.ARPA (Doug Gwyn )
Newsgroups: comp.std.c
Subject: Re: char *strcat(), *strcpy(), *fgets();
Message-ID: <8148@brl-smoke.ARPA>
Date: 24 Jun 88 11:56:55 GMT
References:  <1719@ogcvax.ogc.edu> <1309@ark.cs.vu.nl> <2029@pt.cs.cmu.edu> <2030@pt.cs.cmu.edu>
Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) )
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 5

In article <2030@pt.cs.cmu.edu> jgm@k.gp.cs.cmu.edu (John Myers) writes:
>#define SAVESTR(s) (strcpy(malloc(strlen(s)+1),(s)))

Most of us call this function strdup(), and we test for NULL before
proceeding (since malloc() can fail).