Used a correct definition of malloc.
This commit is contained in:
parent
a33d0e8e14
commit
aef211ad4e
1 changed files with 5 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue