summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzyp <zyp@localhost>2006-10-22 13:09:32 +0200
committerzyp <zyp@localhost>2006-10-22 13:09:32 +0200
commit06b49ba69db808608690395778f3608ea51c8d74 (patch)
tree61ef933fd5e279a329448926e8814731491718cc /src
parentf93b71da9bcd01d7c1db797d9a84b95cbdabde0b (diff)
[project @ zyp-20061022110932-00381ac920067c75]
[project @ 61] Allocating buffer from heap rather than stack.
Diffstat (limited to 'src')
-rw-r--r--src/hash.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hash.cpp b/src/hash.cpp
index 82df4c0..c4adcd4 100644
--- a/src/hash.cpp
+++ b/src/hash.cpp
@@ -62,10 +62,11 @@ namespace Multihash {
}
void _hash_file(int fileno, Hash* hash) {
- char buf[32768];
+ char* buf = new char[32768];
int s;
while((s = read(fileno, buf, 32768)) > 0) {
hash->_update(buf, s);
}
+ delete buf;
}
}