Skip to content

Commit

Permalink
cc: correct handling of allocn(0, 1, d)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Nov 11, 2009
1 parent d38630f commit ae39a1d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cmd/cc/lex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,9 +1566,8 @@ alloc(int32 n)
void*
allocn(void *p, int32 n, int32 d)
{

if(p == nil)
return alloc(d);
return alloc(n+d);
p = realloc(p, n+d);
if(p == nil) {
print("allocn out of mem\n");
Expand Down

0 comments on commit ae39a1d

Please sign in to comment.