TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Andrew Clarke
from: Bo Simonsen
date: 2004-01-28 08:48:56
subject: [C] Question about external variable initialization

BS> char* strdup(char* text)
 BS> {
 BS>         char* tmptext = NULL;

 BS>         if(text) /* if text is not NULL */
 BS>         {
 BS>                 tmptext = malloc(strlen(text)+1); 
 BS>                 /* allokate the lenght of text and 
 BS> 1 extra char for the 
 BS>                    string NULL termination */

 ac>                      if (tmptext == NULL)
 ac>                          return NULL;

correctly, I do allways assume that we have enough mem, I know it's a bad thing :)

BTW Would you take a CVS snapshot of Maximus and see why I doesn't compile
at FreeBSD, I doesn't have a machine right now which I can install FreeBSD
on.

Bo


--- Maximus/UNIX 3.03b
* Origin: The Night Express - Roennede, Dk (2:236/100)
SEEN-BY: 633/267 270
@PATH: 236/100 237/9 20/11 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.