public
/
ack.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4a5979
)
1 - Changed argument from int to unsigned.
author
keie
<none@none>
Mon, 21 Jan 1985 23:54:46 +0000
(23:54 +0000)
committer
keie
<none@none>
Mon, 21 Jan 1985 23:54:46 +0000
(23:54 +0000)
2 - The test for a failed malloc is changed from comparison to -1
to comparison to 0.
lang/basic/lib/salloc.c
patch
|
blob
|
history
diff --git
a/lang/basic/lib/salloc.c
b/lang/basic/lib/salloc.c
index
f968fb4
..
3e13b7d
100644
(file)
--- a/
lang/basic/lib/salloc.c
+++ b/
lang/basic/lib/salloc.c
@@
-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);
}