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:
keie 1985-01-21 23:54:46 +00:00
parent d4a597912f
commit c2e988c3d5

View file

@ -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);
}