mirror of
https://github.com/attractivechaos/klib
synced 2025-01-15 15:09:19 +03:00
Two bugs reported by istreeter and wanghc78
This commit is contained in:
parent
15ddda3d9d
commit
7aa0927bb0
6
kvec.h
6
kvec.h
@ -81,10 +81,10 @@ int main() {
|
||||
(v).a = (type*)realloc((v).a, sizeof(type) * (v).m), 0) \
|
||||
: 0), ((v).a + ((v).n++))
|
||||
|
||||
#define kv_a(type, v, i) ((v).m <= (size_t)(i)? \
|
||||
#define kv_a(type, v, i) (((v).m <= (size_t)(i)? \
|
||||
((v).m = (v).n = (i) + 1, kv_roundup32((v).m), \
|
||||
(v).a = (type*)realloc((v).a, sizeof(type) * (v).m), 0) \
|
||||
: (v).n <= (size_t)(i)? (v).n = (i) \
|
||||
: 0), (v).a[(i)]
|
||||
: (v).n <= (size_t)(i)? (v).n = (i) + 1 \
|
||||
: 0), (v).a[(i)])
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user