Uniform syscap length.

Signed-off-by: yudechen <chenyude@huawei.com>
Change-Id: I68c43b300e2a729aae0a1aa7a287ee1916b1c5a1
This commit is contained in:
yudechen
2022-06-23 19:08:54 +08:00
parent ece61f39a5
commit c00a36983f
8 changed files with 46 additions and 35 deletions
+6 -1
View File
@@ -247,8 +247,13 @@ bool DecodePrivateSyscap(char *input, char (**output)[SINGLE_SYSCAP_LEN], int *o
}
inputPos++;
}
inputPos = input;
if (syscapCnt == 0) {
*output = outputArray;
*outputCnt = syscapCnt;
return true;
}
inputPos = input;
bufferLen = SINGLE_SYSCAP_LEN * syscapCnt;
outputArray = (char (*)[SINGLE_SYSCAP_LEN])malloc(bufferLen);
if (outputArray == NULL) {
+5 -1
View File
@@ -19,9 +19,13 @@
#include <stdbool.h>
#include <stdint.h>
#ifndef SINGLE_SYSCAP_LEN
#define SINGLE_SYSCAP_LEN (256 + 17)
#endif // SINGLE_SYSCAP_LEN
#define MAX_MISS_SYSCAP 512
#define SINGLE_SYSCAP_LEN 256
#define PCID_MAIN_BYTES 128
#define PCID_MAIN_INTS 32
#define E_OK 0
#define E_APIVERSION 1
#define E_SYSCAP 2