summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-03-02 14:25:06 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-03-02 14:25:06 +0100
commit84413b1fe3811b2d07e0be4602c817580a3e4e92 (patch)
tree2595bff6fce049b6c54792be8fc094c3d1ea0e33 /src/fastd.h
parent65af86308981328697bbf06b0818dd4e4f8dfc58 (diff)
downloadfastd-84413b1fe3811b2d07e0be4602c817580a3e4e92.tar
fastd-84413b1fe3811b2d07e0be4602c817580a3e4e92.zip
Print error message on aborts due to buffer push/pull errors
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fastd.h b/src/fastd.h
index 880b6f0..703e463 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -385,17 +385,17 @@ static inline void fastd_buffer_free(fastd_buffer_t buffer) {
free(buffer.base);
}
-static inline void fastd_buffer_pull_head(fastd_buffer_t *buffer, size_t len) {
+static inline void fastd_buffer_pull_head(const fastd_context_t *ctx, fastd_buffer_t *buffer, size_t len) {
buffer->data -= len;
buffer->len += len;
if (buffer->data < buffer->base)
- abort();
+ exit_bug(ctx, "tried to pull buffer across head");
}
-static inline void fastd_buffer_push_head(fastd_buffer_t *buffer, size_t len) {
+static inline void fastd_buffer_push_head(const fastd_context_t *ctx, fastd_buffer_t *buffer, size_t len) {
if (buffer->len < len)
- abort();
+ exit_bug(ctx, "tried to push buffer across tail");
buffer->data += len;
buffer->len -= len;