diff options
author | Tucker Evans <tucker@tuckerevans.com> | 2020-07-03 01:18:39 -0400 |
---|---|---|
committer | Tucker Evans <tucker@tuckerevans.com> | 2020-07-04 23:11:47 -0400 |
commit | a691f4d4b0a57d62eb792e6ede0c0fa5334e3e61 (patch) | |
tree | 767bbb27342f4d4053346ed96b0eb7614871389e | |
parent | 1a41fe605ab6bde15f622e72abb7aee846531fcf (diff) |
Fix bounds checking for vector pop
Would have failed given a negative index.
-rw-r--r-- | collections/vector/vector.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/collections/vector/vector.c b/collections/vector/vector.c index 9ae30c7..79e31a4 100644 --- a/collections/vector/vector.c +++ b/collections/vector/vector.c @@ -135,7 +135,7 @@ void *item; void* vec_pop(root) vec *root; { - if (!root || root->end == 0) { + if (!root || root->end <= 0) { return NULL; } |