1. 修复HVector Insert问题
This commit is contained in:
parent
18573eae26
commit
0da93d100c
@ -4,8 +4,13 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifndef LogD
|
||||
#if 0
|
||||
#include <stdio.h>
|
||||
#define LogD(format, ...) printf("[%s:%s:%d]" format "\r\n", __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define LogD(...)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
static void InitVector(HVectorType *vector) {
|
||||
@ -138,8 +143,8 @@ uint8_t HVectorAddData(HVectorType *vector, HVectorDataType data) {
|
||||
|
||||
uint8_t HVectorInsertData(HVectorType *vector, HVectorLenType index, HVectorDataType data) {
|
||||
HVectorLenType len = GetVectorUseLen(vector);
|
||||
if (index > len) {
|
||||
LogD("index[%d] error, len[%d]", index, len);
|
||||
if (index > len || len >= GetVectorLen(vector)) {
|
||||
LogD("index[%d] error, useLen[%d], len[%d]", index, len, GetVectorLen(vector));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user