Used a correct definition of malloc.
This commit is contained in:
parent
fd84b38268
commit
22d8081884
@ -1,10 +1,12 @@
|
|||||||
/* $Header $ */
|
/* $Header$ */
|
||||||
|
|
||||||
|
extern char *malloc() ;
|
||||||
|
|
||||||
char * salloc(length)
|
char * salloc(length)
|
||||||
int length;
|
int length;
|
||||||
{
|
{
|
||||||
char *c, *s;
|
char *c, *s;
|
||||||
c= (char *) malloc(length);
|
c= malloc(length);
|
||||||
if( c== (char *) -1) error(5);
|
if( c== (char *) -1) error(5);
|
||||||
for(s=c;s<c+length;s++) *s = 0;
|
for(s=c;s<c+length;s++) *s = 0;
|
||||||
return(c);
|
return(c);
|
||||||
@ -13,6 +15,6 @@ int length;
|
|||||||
sfree(c)
|
sfree(c)
|
||||||
char *c;
|
char *c;
|
||||||
{
|
{
|
||||||
if( c== 0) return;
|
if( !c ) return;
|
||||||
free(c);
|
free(c);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user