Fix confusing if vec_len is bytes or number of elements

This commit is contained in:
Nils O. Selåsdal
2014-08-26 20:12:22 +02:00
parent 225943aef7
commit 44ecb1ea7a
+2
View File
@@ -1,4 +1,5 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "ucore/bitvec.h"
@@ -68,6 +69,7 @@ void uc_bv_set_bits_from_array(struct UCBitVec *v,char *array,size_t array_len)
for (i = 0; i < array_len; i++) {
size_t idx = (size_t)bit_index(array_len);
if (unlikely(idx >= v->vec_len))
break;