Newsgroups: comp.lang.c
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!cci632!ritcsh!gregory
From: gregory@ritcsh.csh.rit.edu (Greg Conway)
Subject: Re: Novice question about malloc and pointers
Message-ID: <1991Apr29.224347.13746@ritcsh.csh.rit.edu>
Organization: Computer Science House @ RIT, Rochester, NY.
References: <9104171614.AA14362@enuxha.eas.asu.edu> <1139@gtenmc.UUCP>
Date: Mon, 29 Apr 1991 22:43:47 GMT
Lines: 12

In article <1139@gtenmc.UUCP> csp@gtenmc.UUCP () writes:
>	    for ( i = 0 ; i < MAX ; i++ )
>	       str[i] = malloc(strlen(gets(buff)+1)),
>	       strcpy(str[i],buff);

My, my, my -- live on the edge, don't we?
Using malloc without checking the return value is risky, at best...

						- Greg

-- 
		Gregory Conway @ Computer Science House, RIT
