summaryrefslogtreecommitdiff
path: root/src/piece-table.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/piece-table.c')
-rw-r--r--src/piece-table.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/piece-table.c b/src/piece-table.c
index 3cb1a3e..a41cf00 100644
--- a/src/piece-table.c
+++ b/src/piece-table.c
@@ -145,6 +145,7 @@ void insert_piece_table(piece_table *pt, size_t pos, char *in, size_t in_len) {
piece *start, *end, *new;
assert( pos <= pt->length );
+ assert( in_len > 0 );
append_growable_buffer(&pt->add, in, in_len);
@@ -182,6 +183,7 @@ void delete_piece_table(piece_table *pt, size_t pos, size_t len) {
piece *cur, *next, *start, *end;
size_t off_start;
assert( pos + len <= pt->length );
+ assert( len > 0 );
if ( pos == 0 ) {
start = pt->sentinel;