projects
/
ecparse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d09585
)
fix resizing of buffer
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Sat, 5 Jul 2008 17:22:49 +0000
(19:22 +0200)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Sat, 5 Jul 2008 17:22:49 +0000
(19:22 +0200)
GrowingBuffer.cpp
patch
|
blob
|
history
diff --git
a/GrowingBuffer.cpp
b/GrowingBuffer.cpp
index
8e3bd4a
..
2841741
100644
(file)
--- a/
GrowingBuffer.cpp
+++ b/
GrowingBuffer.cpp
@@
-58,7
+58,7
@@
void GrowingBuffer::write(const void* buffer, size_t length) {
} while (length > (newSize - limit));
GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] resizing buffer from %d to %d bytes to fit in %d bytes.\n", __FILE__, __LINE__, size, newSize, length);
void* newData = malloc(newSize);
- memcpy(newData, data,
position
);
+ memcpy(newData, data,
limit
);
free(data);
data = newData;
}