repositories
/
sws1-1415.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
thing
[sws1-1415.git]
/
ass4
/
mart
/
sws1-assignment4-s4109503-s4202015
/
exercise1.c
diff --git
a/ass4/mart/sws1-assignment4-s4109503-s4202015/exercise1.c
b/ass4/mart/sws1-assignment4-s4109503-s4202015/exercise1.c
index
8393cd8
..
c4b9d06
100644
(file)
--- a/
ass4/mart/sws1-assignment4-s4109503-s4202015/exercise1.c
+++ b/
ass4/mart/sws1-assignment4-s4109503-s4202015/exercise1.c
@@
-3,9
+3,9
@@
int main(void)
{
- size_t s = 0;
char *buf;
char dir = 1;
+ size_t s = 0;
for(size_t i = 1 << 31; i >= 1; i /= 2, free(buf))
dir = (buf = malloc(s += dir * i)) == NULL ? -1 : 1;
printf("One malloc can allocate at most %zu bytes\n", s);