1 - Changed argument from int to unsigned.
2 - The test for a failed malloc is changed from comparison to -1 to comparison to 0.
This commit is contained in:
parent
d4a597912f
commit
c2e988c3d5
|
@ -3,11 +3,11 @@
|
|||
extern char *malloc() ;
|
||||
|
||||
char * salloc(length)
|
||||
int length;
|
||||
unsigned length;
|
||||
{
|
||||
char *c, *s;
|
||||
c= malloc(length);
|
||||
if( c== (char *) -1) error(5);
|
||||
if( !c ) error(5);
|
||||
for(s=c;s<c+length;s++) *s = 0;
|
||||
return(c);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue